Files
kustomize/go.work.sum
Mauren Berti 30893b0184 feat: edit set configmap (#5391)
* feat: add new command 'edit set configmap'

* Add a new command 'edit set configmap' to allow editing the values of an
  already-existing configmap in a kustomization file.
* Add tests to validate the new feature.

* fix: add tests, minor refactoring to use constants

* Include tests to validade the new function ValidateSet, included to do
  necessary validations when running the 'kustomize edit set configmap' command.
* Minor refactorings to use the existing constants in the 'edit set configmap'
  command.
* Add dashes before each item in the comment explaining how ExpandFileSource()
  works so IDEs don't try to reformat the list and remove the indentation in it.
* Because this change mutates the list of literal sources, ensure that both add
  and set save the resulting list in a predictable order to make it easier to
  check when new items are added/removed and aid in testing.
* Since literal sources are the only bit that's important in this test, verify
  that the literal sources in the actual result is equal to what we expected it
  to be.

* fix: change format to print resource name

Use '%q' formatter instead of '%s' to print resource name

Co-authored-by: Varsha <varshaprasad96@gmail.com>

* fix: add changes from code review

* Unexport constant that is used only in the scope of a single function.
* Add extra validation to ensure format is correct with one single '=' per key-value
  pair.
* Add extra set of tests to validate format.
* Update test case to match new printed format in the error message.

* fix: rollback sort for edit add/set configmap

* chore: rename test package and unexport functions

Rename the test package from set_test back to set and unexport functions that do
not need to be exported anymore for testing purposes.

* feat: handle empty and default namespace as equal

Handle the empty and the default namespaces as equal. Add tests to validate this
scenario.

---------

Co-authored-by: Varsha <varshaprasad96@gmail.com>
2023-11-17 19:14:53 +01:00

23 KiB