-
Notifications
You must be signed in to change notification settings - Fork 129
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
feat(state) support multiple files in args #137
Conversation
0d61ea6
to
74eebfe
Compare
Can you please add a test case in the |
e1a1857
to
6e13955
Compare
done @hbagdi |
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.
One cosmetic change, otherwise looks good.
I was a little surprised to see how easy it was to add this.
cmd/sync.go
Outdated
syncCmd.Flags().StringVarP(&syncCmdKongStateFile, | ||
"state", "s", "kong.yaml", "file containing Kong's configuration. "+ | ||
syncCmd.Flags().StringSliceVarP(&syncCmdKongStateFile, | ||
"state", "s", []string{"kong.yaml"}, "file containing Kong's configuration. "+ |
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.
Let's change the help test to instead:
file(s) containing Kong's configuration.
This flag can be specified multiple times for multiple files.
Use '-' to read from stdin.
Please note the line jumps. We want that in the --help
output.
Please change this in all other commands as well.
assert := assert.New(t) | ||
assert.Equal("-", filename) | ||
assert.Equal("-", filenames[0]) |
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.
There is an interesting case where some configuration can be specified via Stdin and other via flag.
I was considering to restrict -
as standalone, meaning you either specify only file(s) or only Stdin.
I think it is okay to allow it.
Just leaving a thought. No changes required.
Thank you @hbagdi! |
Expect a release in a couple of weeks. |
Objective:
I have different state-directories for each environment (ex: production, staging)
And I want to have common configuration for both environments,
so I could create a symlink for a common directory inside each environment directory.
(ex: production/common -> ../common)
Problem:
Currently, deck-cli state flag (--state) supports only one argument that can be a file or directory.
As filepath.Walk does not follow symlinks, deck will ignore symlinks found in the state directory.
Solution:
Supporting multiple arguments in state flag, we could load multiple state from different locations, as: