Skip to content

Commit

Permalink
Prefix resource dump filenames with group
Browse files Browse the repository at this point in the history
Certain api services have conflicting Resource types, causing resource dumps to overwrite eachother.
This ensures filenames remain unique by prefixing them with the api group
  • Loading branch information
rifelpet committed Oct 4, 2024
1 parent 6241230 commit 1eb8d3c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/dump/resourcedumper.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ type gvrNamespace struct {
}

func (d *gvrNamespace) String() string {
return path.Join(d.namespace, d.gvr.Resource)
var gr string
if d.gvr.Group == "" {
gr = d.gvr.Resource
} else {
gr = fmt.Sprintf("%v.%v", d.gvr.Group, d.gvr.Resource)
}
return path.Join(d.namespace, gr)
}

type resourceDumper struct {
Expand Down

0 comments on commit 1eb8d3c

Please sign in to comment.