Add kustomize edit add base command to modify the kustomization.yaml with a base.
/assign
@guineveresaenger: GitHub didn't allow me to assign the following users: guineveresaenger.
Note that only kubernetes-sigs members and repo collaborators can be assigned.
In response to this:
/assign
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/test-infra repository.
Commenting here that I'm set to work on this.
ok, please do
Apologies for the time lag.
As far as I understand it, we have the following edit add commands:
Some questions:
kustomize edit add resource <configMapFile>? Why does a configMap show up differently in kustomization.yaml from other k8s resources.The edit add base functionality should be able to add more than one base, correct? It would make sense for a kustomization to apply to multiple bases.
Adding resources specifies a filepath, but also a file. Adding a base should really just specifile a path to a directory, yes?
How would it break things to use kustomize edit add resource
? Why does a configMap show up differently in kustomization.yaml from other k8s resources.
Having another command edit add resource would be good. It adds resource file to the kustomization.yaml. This command can just append extra files to the resources list in kustomization.yaml, no need to check the type of resources.
In kustomization.yaml, we have an optional filed as configMapGenerators. They are intended to generate configMap resources, but they are not from configMap resource files.
The edit add base functionality should be able to add more than one base, correct? It would make sense for a kustomization to apply to multiple bases.
That's correct. kustomization supports multiple bases.
Adding resources specifies a filepath, but also a file. Adding a base should really just specifile a path to a directory, yes?
a base is a relative path to a directory
a resource is a relative path to a file
@guineveresaenger Let me know if you need other help
@Liujingfang1 actually if you could possibly explain the steps on how to build the binary locally?
Running go build kustomize.go on master gives me the following error when I try executing the binary:
@guin:kustomize (master) 🦉 go build kustomize.go
@guin:kustomize (master %) 🦉 ./kustomize
./kustomize flag redefined: log_dir
panic: ./kustomize flag redefined: log_dir
goroutine 1 [running]:
flag.(*FlagSet).Var(0xc420092060, 0x1c249a0, 0xc420030670, 0x1b52723, 0x7, 0x1b74c2c, 0x2f)
/usr/local/Cellar/go/1.10.2/libexec/src/flag/flag.go:810 +0x540
flag.(*FlagSet).StringVar(0xc420092060, 0xc420030670, 0x1b52723, 0x7, 0x0, 0x0, 0x1b74c2c, 0x2f)
/usr/local/Cellar/go/1.10.2/libexec/src/flag/flag.go:713 +0x8b
flag.(*FlagSet).String(0xc420092060, 0x1b52723, 0x7, 0x0, 0x0, 0x1b74c2c, 0x2f, 0xc420030660)
/usr/local/Cellar/go/1.10.2/libexec/src/flag/flag.go:726 +0x8b
flag.String(0x1b52723, 0x7, 0x0, 0x0, 0x1b74c2c, 0x2f, 0x11f0c61)
/usr/local/Cellar/go/1.10.2/libexec/src/flag/flag.go:733 +0x69
Hm, it seems like I was having some gopath related issues. I can build locally now.
@guineveresaenger You can use go build -o /some/output/directory/kustomize. Then the binary will be available under some/output/directory.
@guineveresaenger can you share how you solved the "flag redefined" issue?
I'm trying to build v1.0.8 (to make a homebrew pr) but I'm seeing something similar to what you mentioned:
✔ epetrini:kustomize [ v1.0.8 | ✔ ] ➠go build -o ~/bin/kustomize
✔ epetrini:kustomize [ v1.0.8 | ✔ ] ➠~/bin/kustomize version
/Users/epetrini/bin/kustomize flag redefined: log_dir
panic: /Users/epetrini/bin/kustomize flag redefined: log_dir
goroutine 1 [running]:
flag.(*FlagSet).Var(0xc0000ac180, 0x1fc7e80, 0xc0000b88d0, 0x1e3aea3, 0x7, 0x1e654cf, 0x2f)
/usr/local/Cellar/go/1.11/libexec/src/flag/flag.go:805 +0x529
flag.(*FlagSet).StringVar(0xc0000ac180, 0xc0000b88d0, 0x1e3aea3, 0x7, 0x0, 0x0, 0x1e654cf, 0x2f)
/usr/local/Cellar/go/1.11/libexec/src/flag/flag.go:708 +0x8a
flag.(*FlagSet).String(0xc0000ac180, 0x1e3aea3, 0x7, 0x0, 0x0, 0x1e654cf, 0x2f, 0xc0000b88c0)
/usr/local/Cellar/go/1.11/libexec/src/flag/flag.go:721 +0x8b
flag.String(0x1e3aea3, 0x7, 0x0, 0x0, 0x1e654cf, 0x2f, 0xc000117e01)
/usr/local/Cellar/go/1.11/libexec/src/flag/flag.go:728 +0x69
Most helpful comment
@guineveresaenger can you share how you solved the "flag redefined" issue?
I'm trying to build v1.0.8 (to make a homebrew pr) but I'm seeing something similar to what you mentioned: