-
Notifications
You must be signed in to change notification settings - Fork 456
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
cmd: crictl: add a config command #194
Conversation
Bump |
@runcom Thanks! This is really useful! |
cmd/crictl/config.go
Outdated
configFile := context.GlobalString("config") | ||
if _, err := os.Stat(configFile); err != nil { | ||
// can't continue w/o config file | ||
logrus.Fatalf("Falied to load config file: %v", err) |
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.
Can we create an empty config here instead?
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.
fixed
cmd/crictl/config.go
Outdated
// Get config from file. | ||
config, err := ReadConfig(configFile) | ||
if err != nil { | ||
logrus.Fatalf("Falied to load config file: %v", err) |
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.
Can we return error instead? And same for the other log.
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.
Agreed. We can create the default config file /etc/crictl.yaml
if it doesn't exist.
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.
fixed
LGTM other than the comments. |
@runcom Thanks for adding this. |
Signed-off-by: Antonio Murdaca <[email protected]>
Comments addressed guys |
This is a fairly simple patch that just adds a
config
command to get and set configurations similar togit config
.This would be very needed for higher level commands like
kubeadm
in order to gather stuff like theruntime-endpoint
to query.@feiskyer @Random-Liu PTAL
Signed-off-by: Antonio Murdaca [email protected]