mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 05:30:26 +00:00
update cloud-controller-manager samples to read --cloud-config flag
This commit is contained in:
@@ -33,7 +33,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/spf13/pflag"
|
||||
cloudprovider "k8s.io/cloud-provider"
|
||||
|
||||
"k8s.io/cloud-provider"
|
||||
"k8s.io/cloud-provider/app"
|
||||
cloudcontrollerconfig "k8s.io/cloud-provider/app/config"
|
||||
"k8s.io/cloud-provider/options"
|
||||
@@ -56,9 +57,6 @@ const (
|
||||
func main() {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
|
||||
// cloudProviderConfigFile shows an sample of parse config file from flag option
|
||||
var flagset *pflag.FlagSet = pflag.NewFlagSet("flagSet", pflag.ContinueOnError)
|
||||
var cloudProviderConfigFile *string = flagset.String("cloud-provider-configfile", "", "This is the sample input for cloud provider config file")
|
||||
pflag.CommandLine.ParseErrorsWhitelist.UnknownFlags = true
|
||||
_ = pflag.CommandLine.Parse(os.Args[1:])
|
||||
|
||||
@@ -75,7 +73,7 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
cloud, err := cloudprovider.InitCloudProvider(cloudProviderName, *cloudProviderConfigFile)
|
||||
cloud, err := cloudprovider.InitCloudProvider(cloudProviderName, c.ComponentConfig.KubeCloudShared.CloudProvider.CloudConfigFile)
|
||||
if err != nil {
|
||||
klog.Fatalf("Cloud provider could not be initialized: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user