-
Notifications
You must be signed in to change notification settings - Fork 223
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
replacements documentation #158
replacements documentation #158
Conversation
/hold |
ead2042
to
35e0389
Compare
site/content/en/references/kustomize/kustomization/replacements/_index.md
Outdated
Show resolved
Hide resolved
site/content/en/references/kustomize/kustomization/replacements/_index.md
Outdated
Show resolved
Hide resolved
site/content/en/references/kustomize/kustomization/replacements/_index.md
Outdated
Show resolved
Hide resolved
site/content/en/references/kustomize/kustomization/replacements/_index.md
Outdated
Show resolved
Hide resolved
site/content/en/references/kustomize/kustomization/replacements/_index.md
Outdated
Show resolved
Hide resolved
As someone who saw the release notes and would be interested to use this — would it be possible to explain the delimiter more? If we have something like: apiVersion: v1
kind: ServiceAccount
metadata:
name: sa-foo
annotations:
iam.gke.io/gcp-service-account: sa@$PROJECT.iam.gserviceaccount.com is it possible to replace that |
@max-sixty No unfortunately; the replacement transformer would not be able to replace vars in this case. Mentioning @justinsb because he had a similar question. if you have something like Then the replacement transformer would have something like:
and it would replace VALUE, e.g. I'll add some examples to clarify. Unfortunately, we don't have a way to replace arbitrary substrings in the middle of a string yet. @monopole Any thoughts? |
35e0389
to
45f02dc
Compare
45f02dc
to
58e5ea5
Compare
@max-sixty We are considering an approach like kubernetes-sigs/kustomize#3914 for cases such as yours. If you would like to take a look and provide feedback there, that would be appreciated. |
@max-sixty Suggest for now using replacement, but replace the whole field, i.e. the entire string a "normalization" problem arises if $PROJECT appears in other strings, because then one has to have multiple weird strings which violates don't repeat yourself. I think the right way to go this is with generators, so we're working on that now. |
/retest |
58e5ea5
to
988be0d
Compare
Great, thanks! And overall this is in a tolerable place for now — even before replacements. The
FWIW I didn't understand this — isn't the current solution violating DRY, because we need to have a patch / replacement for each string containing |
@max-sixty So ideally one would have a means of replacing just one thing
instead of two things (where one repeats part of the replacement)
We think this can be solved with a generator parameterized by PROJECT (and maybe some per cloud stuff) |
Yes exactly @monopole ! That may be easier said than done — e.g. if something replaces Thanks! |
988be0d
to
5b01d80
Compare
/hold cancel |
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.
/lgtm
thanks!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: monopole, natasha41575 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 |
Changes: 4.5.7 ----- Due to an oversight, kustomize v4.5.6 has the golang testing library compiled in unnecessarily. This is a rerelease with the same functionality, but without the unnecessary additional library compiled in. 4.5.6 ----- Due to an oversight, kustomize v4.5.6 has the golang testing library compiled in unnecessarily. It is advised that you upgrade to v4.5.7, which doesn't have the testing library compiled in. 4.5.5 ----- This release is expected to have significant performance improvements for a good portion of inputs, due to #4568. 4.5.4 ----- Dependencies updates. 4.5.3 ----- Misc enhancements and bug fixes. 4.5.2 ----- Bug fix release. 4.5.1 ----- Known issues: - kubernetes-sigs/kustomize#4455 A regression, some HTTP urls are not working properly. 4.5.0 ----- - This release contains a regression in the legacy sort order. Those using the legacy sort, i.e. `kustomize build` with `--reorder` unset or explicitly set to `legacy`, are advised to skip this release. kubernetes-sigs/kustomize#4388 - kubernetes-sigs/kustomize#4455 Another regression, some HTTP urls are not working properly. - New field in kustomization, `buildMetadata`. - New command `kustomize edit add buildmetadata` - Refactor the PrefixSuffixTransformer into separate prefix- and suffix transformers, enabling the user to use the PrefixTransformer or SuffixTransformer individually in the transformers field. - `kustomize build ...` now completes file paths on ZSH. - New command `kustomize edit add generator` (kubernetes-sigs/kustomize#4361) - Deprecate enable-managedby-label flag in favor of a field 4.4.1 ------ Bug fix release. 4.4.0 ----- The headline feature of this release is improved support for YAML anchors and aliases, which will be expanded by default as of this version. Additional features and fixes include: - Added length check on originalFields of kustomizationFile to prevent panic when kustomization file began with a comment(or a blank line) followed by a document separator 4.3.0 ----- Misc bug fixes and enhancements. 4.2.0 ----- New experimental command to automatically migrate `vars` to `replacements`: `kustomize edit fix —vars`. For details, run `kustomize edit fix -h`. Warning: converting `vars` to `replacements` will potentially overwrite many resource files and in rare scenarios may not produce the same output when `kustomize build` is run. We recommend doing this in a clean git repository where the change is easy to undo. 4.1.3 ----- * New experimental ReplacementTransformer, docs on the way: kubernetes-sigs/cli-experimental#158 This will replace the `vars` feature. * Allow pulls of openapi data from live API servers (openapi fetch command). * Remote git urls can specify a timeout parameter. * More examples of helm usage. * Speed up cluster-scoped type checks. * API changes towards 1.0 - `Gvk` and `Resid` types moved to kyaml - `Resource` now inlines `RNode` rather than delegating to it - `Resmap` now accepts an `kio.Filter` visitor (that can change the ResMap size).
No description provided.