Skip to content
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 cloud-provider to k8s_get #784

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/k8s/cmd/k8s/k8s_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func newGetCmd(env cmdutil.ExecutionEnvironment) *cobra.Command {
config := response.Config

config.MetricsServer = apiv1.MetricsServerConfig{}
config.CloudProvider = nil
config.Annotations = nil

var key string
Expand Down Expand Up @@ -116,6 +115,8 @@ func newGetCmd(env cmdutil.ExecutionEnvironment) *cobra.Command {
output = config.LoadBalancer.GetBGPPeerPort()
case fmt.Sprintf("%s.bgp-peer-asn", features.LoadBalancer):
output = config.LoadBalancer.GetBGPPeerASN()
case "cloud-provider":
output = config.GetCloudProvider()
Comment on lines +118 to +119
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if it's unset? I guess that's okay -- it doesn't panic by de referencing nil or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

util.Deref(c.CloudProvider) in the k8s-snap-api dereferences in a safe way. If it's not set, it won't print anything.

default:
cmd.PrintErrf("Error: Unknown config key %q.\n", key)
env.Exit(1)
Expand Down
Loading