From 58513b8c0b3295840e3fea392cf59a942ce1ce27 Mon Sep 17 00:00:00 2001 From: osoriano Date: Sun, 12 Nov 2017 05:09:42 +0000 Subject: [PATCH] Ensure GCE AlphaFeatureGate initialized If no config file is specified for the controller-manager, the GCE CloudConfig.AlphaFeatureGate property is not initialized. This can cause a panic when checking for alpha features in the GCE provider. Closes #55544 --- pkg/cloudprovider/providers/gce/gce.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/cloudprovider/providers/gce/gce.go b/pkg/cloudprovider/providers/gce/gce.go index f86865c4db6..8f456c0a647 100644 --- a/pkg/cloudprovider/providers/gce/gce.go +++ b/pkg/cloudprovider/providers/gce/gce.go @@ -240,6 +240,8 @@ func generateCloudConfig(configFile *ConfigFile) (cloudConfig *CloudConfig, err cloudConfig.TokenSource = google.ComputeTokenSource("") cloudConfig.UseMetadataServer = true + featureMap := make(map[string]bool) + cloudConfig.AlphaFeatureGate = &AlphaFeatureGate{featureMap} if configFile != nil { if configFile.Global.ApiEndpoint != "" { cloudConfig.ApiEndpoint = configFile.Global.ApiEndpoint