feat: add support for 'kustomize edit add configuration' command#6037
feat: add support for 'kustomize edit add configuration' command#6037rohithnarasimha wants to merge 1 commit intokubernetes-sigs:masterfrom
Conversation
|
|
|
Welcome @rohithnarasimha! |
|
Hi @rohithnarasimha. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
0ed0c95 to
5ea06b9
Compare
3ac1ae2 to
218468e
Compare
|
/ok-to-test |
|
@rohithnarasimha: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@koba1t @varshaprasad96 |
|
/ok-to-test |
|
@koba1t Prow shows all tests have passed (https://prow.k8s.io/pr?query=is%3Apr+repo%3Akubernetes-sigs%2Fkustomize+author%3Arohithnarasimha), but the GitHub "Lint" and "Test Summary" checks are stuck in "Waiting for status to be reported". This appears to be a status reporting issue since the actual Prow jobs completed successfully. Could you please review the code and proceed with |
|
/retest |
varshaprasad96
left a comment
There was a problem hiding this comment.
This looks good. Can follow up by adding more tests like: TestAddTransformerNoArgs (to verify no args gives error), verify when customization.yaml is not present, use of wildcard (*).
@koba1t any objections in merging this?
| // Count occurrences - should only appear once | ||
| count := 0 | ||
| data := string(content) | ||
| for i := 0; i < len(data); { |
There was a problem hiding this comment.
Nit (not a blocker) - The manual substring search loop is fragile and hard to read. The transformer test uses a much cleaner approach — read back via kustfile.NewKustomizationFile, parse, and assert len(m.Configurations) == 1. We could also use strings.Count(data, "config.yaml").
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rohithnarasimha, varshaprasad96 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
This PR cannot be merged, till required tests pass. Closing and reopening to see if it re-triggers. |
|
@rohithnarasimha can you fix the linters pls? |
|
sure |
…ation' command Add a new subcommand 'kustomize edit add configuration' to programmatically add configuration file references to kustomization.yaml files. This brings configurations support in line with other 'kustomize edit add' subcommands (generators, transformers, validators). Features: - Support for single and multiple configuration file paths - Glob pattern expansion (e.g., ./configs/*.yaml) - Duplicate detection with user logging - Idempotent operation Related to kubernetes-sigs#5987
218468e to
1af74f2
Compare
Add a new subcommand 'kustomize edit add configuration' to programmatically add configuration file references to kustomization.yaml files. This brings configurations support in line with other 'kustomize edit add' subcommands (generators, transformers, validators).
Features:
Fixes #5987