Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

Use val.Namespace in place of instance.Namespace #1985

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 7 additions & 1 deletion interoperator/internal/resources/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,15 @@
obj := &unstructured.Unstructured{}
obj.SetKind(val.Kind)
obj.SetAPIVersion(val.APIVersion)
valNamespace := func() string {
if val.Namespace == "" {
return name.Namespace

Check warning on line 268 in interoperator/internal/resources/helper.go

View check run for this annotation

Codecov / codecov/patch

interoperator/internal/resources/helper.go#L268

Added line #L268 was not covered by tests
}
return val.Namespace
}()
namespacedName := types.NamespacedName{
Name: val.Name,
Namespace: name.Namespace,
Namespace: valNamespace,
}
err := client.Get(context.TODO(), namespacedName, obj)
if err != nil {
Expand Down