Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(KFLUXBUGS-1754): rp shouldn't show matched if RPA doesn't exist #590

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@

if designatedReleasePlanAdmissionName != "" {
releasePlanAdmission := &v1alpha1.ReleasePlanAdmission{}
return releasePlanAdmission, toolkit.GetObject(designatedReleasePlanAdmissionName, releasePlan.Spec.Target, cli, ctx, releasePlanAdmission)
err := toolkit.GetObject(designatedReleasePlanAdmissionName, releasePlan.Spec.Target, cli, ctx, releasePlanAdmission)
if err != nil {
return nil, err
}
return releasePlanAdmission, nil

Check warning on line 124 in loader/loader.go

View check run for this annotation

Codecov / codecov/patch

loader/loader.go#L124

Added line #L124 was not covered by tests
}

if releasePlan.Spec.Target == "" {
Expand Down
2 changes: 1 addition & 1 deletion loader/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ var _ = Describe("Release Adapter", Ordered, func() {
returnedObject, err := loader.GetMatchingReleasePlanAdmission(ctx, k8sClient, modifiedReleasePlan)
Expect(err).To(HaveOccurred())
Expect(errors.IsNotFound(err)).To(BeTrue())
Expect(returnedObject).To(Equal(&v1alpha1.ReleasePlanAdmission{}))
Expect(returnedObject).To(BeNil())
})

It("fails to return a release plan admission if the target does not match", func() {
Expand Down
Loading