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
fix error message using replacement wildcard and create option #4577
Changes from 2 commits
5e84de2
cdc4a50
01ab069
02e0b38
ed72bb0
2f2e14e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -541,6 +541,9 @@ func (l PathGetter) getFilter(part, nextPart string, fieldPath *[]string) (Filte | |
case part == "-": | ||
// part is a hyphen | ||
return GetElementByIndex(-1), nil | ||
case part == "*": | ||
// part is a asterisk | ||
return nil, errors.Errorf("cannot support create option in a multi-value target now") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Won't it be possible for someone to be attempting to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 The other option is to move the check into the replacement filter, in Also suggest removing the word "now" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I fix it to 01ab069 |
||
case IsListIndex(part): | ||
// part is surrounded by brackets | ||
return l.elemFilter(part) | ||
|
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.
could you please also add the test from https://github.com/kubernetes-sigs/kustomize/pull/4574/files that I added to replacement_test.go, called "create Job spec"?
I pulled your branch and it looks like something funny is going on when running with that test, it would be great if you could help fix that.
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.
For that case, I think we can do something in the code that's here:
kustomize/api/filters/replacement/replacement.go
Lines 119 to 123 in e5041ba
We can potentially try something like this:
to see if it fixes the problem.