Pass in cloud config file to initialize cloud provider - #164
Conversation
|
/assign @andrewsykim |
| } | ||
|
|
||
| cloudConfigFlag := cmd.Flags().Lookup("cloud-config") | ||
| if cloudConfigFlag.Value.String() == "" { |
There was a problem hiding this comment.
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.
so no need to use cmd to look up the flag value.
| os.Exit(1) | ||
| } | ||
|
|
||
| cloudConfigFile := c.ComponentConfig.KubeCloudShared.CloudProvider.CloudConfigFile |
There was a problem hiding this comment.
@andrewsykim updated! I think it would be good to warn when the file path is empty, wdyt?
There was a problem hiding this comment.
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.
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.
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
andrewsykim
left a comment
There was a problem hiding this comment.
/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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pass the value from
--cloud-configflag 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?: