-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
diff: Fix overlapping filenames #71923
diff: Fix overlapping filenames #71923
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: apelisse The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
ad61ab2
to
91f2333
Compare
Disambiguating the name with the kind seems the right solution. And then I wonder, what you think the intended behaviour is, when I have duplicates of kind and name pairs. In the cluster this is not possible, but on disk it is. Which dupe will be picked? It's not handling this case is it? |
|
That should be irrelevant, because kube-apiserver returns just the version we're asking for (same as the version on disk) |
Yeah, this problem is more general than just diff. I'm also less concerned about diff than I am about apply, because diff is not mutating. I think it deserves another issue if you want to see that use-case fixed. I'm pretty sure that diff should behave like apply does: you want to see the changes as they are actually going to happen, and I think it is consistent today. |
91f2333
to
5cd5d84
Compare
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.
5cd5d84
to
b6135f6
Compare
/lgtm |
/kind bug |
group = fmt.Sprintf("%v.", obj.Info.Mapping.GroupVersionKind.Group) | ||
} | ||
return group + fmt.Sprintf( | ||
"%v.%v:%v.%v", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Colons aren't cross-platform safe, are they?
…23-upstream-release-1.13 Automated cherry pick of #71923: 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.
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #71920
Special notes for your reviewer:
Does this PR introduce a user-facing change?: