Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
support JSON Merge Patch and Strategic Merge Patch in Resource Modifiers #6917
support JSON Merge Patch and Strategic Merge Patch in Resource Modifiers #6917
Changes from 3 commits
d8b9328
06ed9dc
58d8425
e880c0d
5932e26
65082f3
19d5bee
a607810
6d89780
d1f5219
4ead4d6
f66016d
e309375
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 24 in internal/resourcemodifiers/json_merge_patch.go
Codecov / codecov/patch
internal/resourcemodifiers/json_merge_patch.go#L23-L24
Check warning on line 30 in internal/resourcemodifiers/json_merge_patch.go
Codecov / codecov/patch
internal/resourcemodifiers/json_merge_patch.go#L29-L30
Check warning on line 35 in internal/resourcemodifiers/json_merge_patch.go
Codecov / codecov/patch
internal/resourcemodifiers/json_merge_patch.go#L34-L35
Check warning on line 42 in internal/resourcemodifiers/json_merge_patch.go
Codecov / codecov/patch
internal/resourcemodifiers/json_merge_patch.go#L41-L42
Check warning on line 62 in internal/resourcemodifiers/json_patch.go
Codecov / codecov/patch
internal/resourcemodifiers/json_patch.go#L62
Check warning on line 69 in internal/resourcemodifiers/json_patch.go
Codecov / codecov/patch
internal/resourcemodifiers/json_patch.go#L68-L69
Check warning on line 79 in internal/resourcemodifiers/json_patch.go
Codecov / codecov/patch
internal/resourcemodifiers/json_patch.go#L78-L79
Check warning on line 84 in internal/resourcemodifiers/json_patch.go
Codecov / codecov/patch
internal/resourcemodifiers/json_patch.go#L83-L84
Check warning on line 68 in internal/resourcemodifiers/resource_modifiers.go
Codecov / codecov/patch
internal/resourcemodifiers/resource_modifiers.go#L68
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.
one thing came in my mind
if we support globbing with namespace filter.
Scenario -> user provided NS filter, with path glob as blah*
Now blah* can contain both cluster scope and namespaced scope CRs.
We need to make it clear in docs that if user wants to do cluster scope they have to put NS filter as empty otherwise it won't work
and using it in conjunction with GroupResource glob path will have these further nuances.
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.
namespaces: ["blah*"]
, only namespaced resources in namespace started with blah will be matchedThere 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.
yeah
again the limitation is cluster scope won't be taken care of
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.
sorry, not quite understand, can you give an example?
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.
user provided NS filter (default), with GroupResource glob as blah*
Now blah* can contain both cluster scope and namespaced scope CRs.
We need to make it clear in docs that if user wants to do cluster scope they have to put NS filter as empty otherwise it won't work
and using it in conjunction with GroupResource glob path will have these further nuances.
Reworded my initial comment to make it more clear
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.
" I think including the cluster resources by default is reasonable"
I feel this would lead to changes which are not intended.
I am worried about this.
In terms of REAL filters here - similar to what we have in backup /restore - includeClusterSCopeResources
We can add a bool for that.
that would make it consistent and give control to user.
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.
This is only useful for globbed patterns
but would lead to confusion if explicit GroupResource is mentioned.
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.
On further thought, I think it's fine.
But PLEASE just add this behaviour of cluster scope by default to docuemtnation.
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.
Just to reiterate, I am fine with current changes you have. Just that I request you to document the behaviour of cluster scope by default in case of globbed GroupResourcce.
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.
thanks, updated
Check warning on line 125 in internal/resourcemodifiers/resource_modifiers.go
Codecov / codecov/patch
internal/resourcemodifiers/resource_modifiers.go#L125
Check warning on line 133 in internal/resourcemodifiers/resource_modifiers.go
Codecov / codecov/patch
internal/resourcemodifiers/resource_modifiers.go#L133
Check warning on line 165 in internal/resourcemodifiers/resource_modifiers.go
Codecov / codecov/patch
internal/resourcemodifiers/resource_modifiers.go#L165