From 22148a65c80a4495f3206cea75b146413ea5ad06 Mon Sep 17 00:00:00 2001 From: Bruce Campbell Date: Tue, 19 Dec 2017 10:06:28 -0800 Subject: [PATCH] Add linux side custom bootstrap url to vlabs api --- pkg/acsengine/engine.go | 3 +++ pkg/api/converterfromapi.go | 1 + pkg/api/convertertoapi.go | 1 + pkg/api/types.go | 1 + pkg/api/vlabs/types.go | 1 + pkg/api/vlabs/validate_test.go | 5 +++++ 6 files changed, 12 insertions(+) diff --git a/pkg/acsengine/engine.go b/pkg/acsengine/engine.go index 3dedf5f200..85ee3c99ec 100644 --- a/pkg/acsengine/engine.go +++ b/pkg/acsengine/engine.go @@ -711,6 +711,9 @@ func getParameters(cs *api.ContainerService, isClassicMode bool, generatorCode s if properties.OrchestratorProfile.DcosConfig.DcosWindowsBootstrapURL != "" { dcosWindowsBootstrapURL = properties.OrchestratorProfile.DcosConfig.DcosWindowsBootstrapURL } + if properties.OrchestratorProfile.DcosConfig.DcosBootstrapURL != "" { + dcosBootstrapURL = properties.OrchestratorProfile.DcosConfig.DcosBootstrapURL + } } addValue(parametersMap, "dcosBootstrapURL", dcosBootstrapURL) diff --git a/pkg/api/converterfromapi.go b/pkg/api/converterfromapi.go index 2a46fd4120..9ada630d3a 100644 --- a/pkg/api/converterfromapi.go +++ b/pkg/api/converterfromapi.go @@ -638,6 +638,7 @@ func convertOrchestratorProfileToVLabs(api *OrchestratorProfile, o *vlabs.Orches } func convertDcosConfigToVLabs(api *DcosConfig, vlabs *vlabs.DcosConfig) { + vlabs.DcosBootstrapURL = api.DcosBootstrapURL vlabs.DcosWindowsBootstrapURL = api.DcosWindowsBootstrapURL } diff --git a/pkg/api/convertertoapi.go b/pkg/api/convertertoapi.go index 67ad70ebdb..acc3c6745c 100644 --- a/pkg/api/convertertoapi.go +++ b/pkg/api/convertertoapi.go @@ -582,6 +582,7 @@ func convertVLabsOrchestratorProfile(vp *vlabs.Properties, api *OrchestratorProf } func convertVLabsDcosConfig(vlabs *vlabs.DcosConfig, api *DcosConfig) { + api.DcosBootstrapURL = vlabs.DcosBootstrapURL api.DcosWindowsBootstrapURL = vlabs.DcosWindowsBootstrapURL } diff --git a/pkg/api/types.go b/pkg/api/types.go index f86af1a9c6..a45fc862be 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -221,6 +221,7 @@ type KubernetesConfig struct { // DcosConfig Configuration for DC/OS type DcosConfig struct { + DcosBootstrapURL string `json:"dcosBootstrapURL,omitempty"` DcosWindowsBootstrapURL string `json:"dcosWindowsBootstrapURL,omitempty"` } diff --git a/pkg/api/vlabs/types.go b/pkg/api/vlabs/types.go index eca5a59a1e..68956f19d6 100644 --- a/pkg/api/vlabs/types.go +++ b/pkg/api/vlabs/types.go @@ -239,6 +239,7 @@ type KubernetesConfig struct { // DcosConfig Configuration for DC/OS type DcosConfig struct { + DcosBootstrapURL string `json:"dcosBootstrapURL,omitempty"` DcosWindowsBootstrapURL string `json:"dcosWindowsBootstrapURL,omitempty"` } diff --git a/pkg/api/vlabs/validate_test.go b/pkg/api/vlabs/validate_test.go index 93e4636cc8..096ff528bd 100644 --- a/pkg/api/vlabs/validate_test.go +++ b/pkg/api/vlabs/validate_test.go @@ -46,6 +46,11 @@ func Test_OrchestratorProfile_Validate(t *testing.T) { t.Errorf("should error when DcosConfig populated for non-Kubernetes OrchestratorType") } + o.DcosConfig.DcosBootstrapURL = "http://www.microsoft.com" + if err := o.Validate(false); err == nil { + t.Errorf("should error when DcosConfig populated for non-Kubernetes OrchestratorType") + } + o = &OrchestratorProfile{ OrchestratorType: "Kubernetes", OrchestratorVersion: "1.7.3",