-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add CLI flag --config
for configuring the global config location
#2555
Add CLI flag --config
for configuring the global config location
#2555
Conversation
16c1607
to
ab53659
Compare
Codecov Report
|
ab53659
to
28c4553
Compare
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.
this actually looks really good! it's definitely more code than before, but I think in general it's easier to reason about. can you rebase so we can get CI green?
also, is this PR meant to be merged before #2590? i'm a bit confused on the order of them since a lot of the code is the same.
pkg/skaffold/config/util_test.go
Outdated
DefaultRepo: "my-public-registry", | ||
}, | ||
}, | ||
/* todo(corneliusweig): this behavior can be enabled with `mergo.WithAppendSlice` -> clarify requirements |
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.
is this something you can address right now? what was stopping you from including it before?
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.
Because the `skaffold config` subcommands are in a separate package, they cannot access this flag, therefore this flag cannot be fully global. Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
- when retrieving the config for a given kube-context, merge the result with the global values - cache merged config - simplify logic of GetInsecureRegistries, GetLocalCluster, and GetDefaultRepo - allow to override ReadConfigFile with uncached implementation for tests Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
This package now uses the config utils from pkg/skaffold/config Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
505f37e
to
91a1d0d
Compare
@corneliusweig thanks! I tried rebasing through the github UI, with surprising success....but then I introduced a lint error and wasn't able to fix that through the UI 🤦♂️ I'll merge this as soon as it's green! |
@nkubala well, that looks like a test flake. Should I trigger again? |
Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
c7ef098
to
2c75a47
Compare
@nkubala I triggered again, so everything is green now :) |
So far,
skaffold config
has a--config
flag, to modify skaffold configs with non-standard locations (default is$HOME/.skaffold/config
). Other Skaffold commands do not have a flag to set the config location (see #2468).This PR adds a config flag to configure the location of the global config for the
run
,dev
,debug
,build
,deploy
,delete
, anddiagnose
subcommands. The reason for not making this flag global (such as--color
) is thatskaffold config
has no access to the Skaffold options, so it would require an awkward workaround. Let me know if this makes sense.To achieve its goal, this PR required a substantial refactoring of the global config handling. I hope it got simpler.
Fixes #2468
Related #2554