Skip to content
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

Implement new feature kpt cfg search(replace) #961

Closed
9 tasks done
phanimarupaka opened this issue Aug 19, 2020 · 5 comments
Closed
9 tasks done

Implement new feature kpt cfg search(replace) #961

phanimarupaka opened this issue Aug 19, 2020 · 5 comments
Assignees
Labels
p1 size/XXL 16 day triaged Issue has been triaged by adding an `area/` label ux impact
Milestone

Comments

@phanimarupaka
Copy link
Contributor

phanimarupaka commented Aug 19, 2020

Implement the new feature kpt cfg search which will help users to effectively search for fields in the yaml configs.

  • Search by value
  • Search by value regex
  • Put literal
  • Add non-existing fields
  • Support search by absolute paths
  • Support path expressions
  • Implement put pattern
  • Fishfood
  • Documentation
@phanimarupaka phanimarupaka self-assigned this Aug 19, 2020
@phanimarupaka phanimarupaka added area/cfg p1 size/L 4 day ux impact triaged Issue has been triaged by adding an `area/` label labels Aug 19, 2020
@phanimarupaka phanimarupaka added size/XL 8 day and removed size/L 4 day labels Oct 13, 2020
@phanimarupaka phanimarupaka changed the title Implement new feature kpt cfg search(replace) Implement new feature kpt cfg search(replace) basic functionality Oct 27, 2020
@phanimarupaka phanimarupaka added size/L 4 day and removed size/XL 8 day labels Oct 27, 2020
@phanimarupaka phanimarupaka changed the title Implement new feature kpt cfg search(replace) basic functionality Implement new feature kpt cfg search(replace) Oct 28, 2020
@phanimarupaka phanimarupaka added size/XXL 16 day and removed size/L 4 day labels Oct 28, 2020
@phanimarupaka
Copy link
Contributor Author

#248 is addressed with by this new feature and not with setters.

@mikebz
Copy link
Contributor

mikebz commented Jan 8, 2021

copying the commentary from @bgrant0607 here #742 (comment)

This issue is the same as the one that motivated the analogous feature in kustomize.
https://github.com/kubernetes/enhancements/blob/master/keps/sig-cli/0008-kustomize.md#long-standing-issues

The tricky part is finding references, which can't be done via naive search and replace.
https://github.com/kubernetes-sigs/kustomize/blob/master/api/konfig/builtinpluginconsts/namereference.go

@phanimarupaka
Copy link
Contributor Author

Search and Replace in kpt is more context aware of KRM resource files. That differentiates it from the native search and replace. It leverages syntax from yq to find the references.

@karlkfi
Copy link
Contributor

karlkfi commented Jul 9, 2021

How was this implemented? I don't see it in the kp v1 docs and none of the links here are to PRs that merged...

@karlkfi
Copy link
Contributor

karlkfi commented Jul 9, 2021

Ah, I see a function: https://catalog.kpt.dev/search-replace/v0.1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1 size/XXL 16 day triaged Issue has been triaged by adding an `area/` label ux impact
Projects
None yet
Development

No branches or pull requests

3 participants