Skip to content

Commit

Permalink
fix: add missing namespace mutations (#47)
Browse files Browse the repository at this point in the history
In most places we already mutated the namespace of resources, in some we
did not, this PR is fixing the gap.
  • Loading branch information
maximilianbraun authored Feb 5, 2024
2 parents 6082353 + 43c4c5e commit 420fd4c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/resources/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func ImportResources(ctx context.Context, t *testing.T, cfg *envconf.Config, dir
t.Fatalf("No yaml files found for %s", dir)
return
}

decoderOptions = append(decoderOptions, decoder.MutateNamespace(cfg.Namespace()))
// managed resources fare cluster scoped, so if we patched them with the test namespace it won't do anything
errdecode := decoder.DecodeEachFile(
ctx, os.DirFS(dir), "*",
Expand Down Expand Up @@ -129,6 +129,7 @@ func getObjectsToImport(ctx context.Context, cfg *envconf.Config, dir string) ([
objects = append(objects, obj)
return nil
},
decoder.MutateNamespace(cfg.Namespace()),
)
return objects, err
}
Expand Down Expand Up @@ -250,6 +251,7 @@ func deleteObjects(ctx context.Context, cfg *envconf.Config, dir string) error {
return decoder.DecodeEachFile(
ctx, os.DirFS(dir), "*",
decoder.DeleteHandler(r),
decoder.MutateNamespace(cfg.Namespace()),
)
}

Expand Down

0 comments on commit 420fd4c

Please sign in to comment.