-
Notifications
You must be signed in to change notification settings - Fork 337
Pass in cloud config file to initialize cloud provider #164
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
Pass in cloud config file to initialize cloud provider #164
Conversation
/assign @andrewsykim |
@@ -109,6 +109,11 @@ func main() { | |||
} | |||
} | |||
|
|||
cloudConfigFlag := cmd.Flags().Lookup("cloud-config") | |||
if cloudConfigFlag.Value.String() == "" { |
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.
I think that the cloud config file would actually be available as c.ComponentConfig.KubeCloudShared.CloudProvider.CloudConfigFile
after we run s.Config()
on line 119.
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.
so no need to use cmd
to look up the flag value.
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.
I see!
@@ -117,8 +117,13 @@ func main() { | |||
os.Exit(1) | |||
} | |||
|
|||
cloudConfigFile := c.ComponentConfig.KubeCloudShared.CloudProvider.CloudConfigFile |
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.
@andrewsykim updated! I think it would be good to warn when the file path is empty, wdyt?
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.
I think the warning isn't needed if the process would exit and fail if it was empty. But we would need to double check if that's the case. If --cloud-config
is optional the warning is probably not needed either.
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.
gotcha, I think the configuration file path is optional by checking the code, so I remove the warning here
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.
The examples should probably be updated as well instead of using a hardcoded path https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/cloud-provider/sample/basic_main.go#L66
bb2e03b
to
3b384bb
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.
/approve
/lgtm
Thanks @nicolehanjing
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewsykim, nicolehanjing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pass the value from
--cloud-config
flag for reading the clusterName valueinitialize cloud provider with the cloud provider name and config file provided
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: