diff --git a/pkg/cloudprovider/provider/gce/cloudconfig.go b/pkg/cloudprovider/provider/gce/cloudconfig.go index 509758096..dc2a80132 100644 --- a/pkg/cloudprovider/provider/gce/cloudconfig.go +++ b/pkg/cloudprovider/provider/gce/cloudconfig.go @@ -34,12 +34,16 @@ import ( // fields are optional, that's why containing the ifs and the explicit newlines. const cloudConfigTemplate = "[global]\n" + "project-id = {{ .Global.ProjectID | iniEscape }}\n" + - "local-zone = {{ .Global.LocalZone | iniEscape }}\n" + "local-zone = {{ .Global.LocalZone | iniEscape }}\n" + + "multizone = {{ .Global.MultiZone }}\n" + + "regional = {{ .Global.Regional }}\n" // GlobalOpts contains the values of the global section of the cloud configuration. type GlobalOpts struct { ProjectID string LocalZone string + MultiZone bool + Regional bool } // CloudConfig contains only the section global. diff --git a/pkg/cloudprovider/provider/gce/cloudconfig_test.go b/pkg/cloudprovider/provider/gce/cloudconfig_test.go index 35f011dd1..379d8afe1 100644 --- a/pkg/cloudprovider/provider/gce/cloudconfig_test.go +++ b/pkg/cloudprovider/provider/gce/cloudconfig_test.go @@ -38,11 +38,15 @@ func TestCloudConfigAsString(t *testing.T) { Global: GlobalOpts{ ProjectID: "my-project-id", LocalZone: "my-zone", + MultiZone: true, + Regional: true, }, }, contents: "[global]\n" + "project-id = \"my-project-id\"\n" + - "local-zone = \"my-zone\"\n", + "local-zone = \"my-zone\"\n" + + "multizone = true\n" + + "regional = true\n", }, }