Skip to content

Commit

Permalink
fix: include namespace in renderedYaml filename
Browse files Browse the repository at this point in the history
This fixes a problem when resources have the same name/kind, but live in different namespaces. This caused the first file written to be overwritten by the later resources.
  • Loading branch information
rawkode committed Jan 18, 2021
1 parent eaf7026 commit 62e2a06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion provider/pkg/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2745,7 +2745,7 @@ func renderPathForResource(resource *unstructured.Unstructured, yamlDirectory st
crdDirectory := filepath.Join(yamlDirectory, "0-crd")
manifestDirectory := filepath.Join(yamlDirectory, "1-manifest")

fileName := fmt.Sprintf("%s-%s.yaml", strings.ToLower(resource.GetKind()), resource.GetName())
fileName := fmt.Sprintf("%s-%s-%s.yaml", strings.ToLower(resource.GetKind()), resource.GetNamespace(), resource.GetName())
filepath.Join(yamlDirectory, fileName)

var path string
Expand Down

0 comments on commit 62e2a06

Please sign in to comment.