diff: Fix overlapping filenames
The filename can overlap when multiple resources have the same name (but obviously are of a different type). Include the name of the type in the file name to prevent the overlap.
This commit is contained in:
@@ -289,7 +289,17 @@ func (obj InfoObject) Merged() (runtime.Object, error) {
|
||||
}
|
||||
|
||||
func (obj InfoObject) Name() string {
|
||||
return obj.Info.Name
|
||||
group := ""
|
||||
if obj.Info.Mapping.GroupVersionKind.Group != "" {
|
||||
group = fmt.Sprintf("%v.", obj.Info.Mapping.GroupVersionKind.Group)
|
||||
}
|
||||
return group + fmt.Sprintf(
|
||||
"%v.%v:%v.%v",
|
||||
obj.Info.Mapping.GroupVersionKind.Version,
|
||||
obj.Info.Mapping.GroupVersionKind.Kind,
|
||||
obj.Info.Namespace,
|
||||
obj.Info.Name,
|
||||
)
|
||||
}
|
||||
|
||||
// Differ creates two DiffVersion and diffs them.
|
||||
|
Reference in New Issue
Block a user