Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
feat: enable azurestack telemetry for scale and upgrade scenarios (#2001
Browse files Browse the repository at this point in the history
)
  • Loading branch information
deaborch authored and jackfrancis committed Oct 1, 2019
1 parent 7a6981d commit 966ac22
Show file tree
Hide file tree
Showing 14 changed files with 149 additions and 21 deletions.
4 changes: 2 additions & 2 deletions cmd/scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ func (sc *scaleCmd) load() error {

if sc.containerService.Properties.IsAzureStackCloud() {
writeCustomCloudProfile(sc.containerService)
err = sc.containerService.Properties.SetAzureStackCloudSpec()
if err != nil {

if err = sc.containerService.Properties.SetAzureStackCloudSpec(api.AzureStackCloudSpecParams{IsUpgrade: false, IsScale: true}); err != nil {
return errors.Wrap(err, "error parsing the api model")
}
}
Expand Down
7 changes: 5 additions & 2 deletions cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,11 @@ func (uc *upgradeCmd) loadCluster() error {

if uc.containerService.Properties.IsAzureStackCloud() {
writeCustomCloudProfile(uc.containerService)
err = uc.containerService.Properties.SetAzureStackCloudSpec()
if err != nil {

if err = uc.containerService.Properties.SetAzureStackCloudSpec(api.AzureStackCloudSpecParams{
IsUpgrade: true,
IsScale: false,
}); err != nil {
return errors.Wrap(err, "error parsing the api model")
}
}
Expand Down
15 changes: 15 additions & 0 deletions pkg/api/azenvtypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type DCOSSpecConfig struct {

//KubernetesSpecConfig is the kubernetes container images used.
type KubernetesSpecConfig struct {
AzureTelemetryPID string `json:"azureTelemetryPID,omitempty"`
KubernetesImageBase string `json:"kubernetesImageBase,omitempty"`
TillerImageBase string `json:"tillerImageBase,omitempty"`
ACIConnectorImageBase string `json:"aciConnectorImageBase,omitempty"`
Expand Down Expand Up @@ -64,6 +65,20 @@ type AzureOSImageConfig struct {
ImageVersion string `json:"imageVersion,omitempty"`
}

// AzureTelemetryPID represents the current telemetry ID
// See more information here https://docs.microsoft.com/en-us/azure/marketplace/azure-partner-customer-usage-attribution
// PID is maintained to keep consistent with Azure Stack Telemetry Terminologies
type AzureTelemetryPID string

const (
// DefaultAzureStackDeployTelemetryPID tracking ID for Deployment
DefaultAzureStackDeployTelemetryPID = "pid-1bda96ec-adf4-4eea-bb9a-8462de5475c0"
// DefaultAzureStackScaleTelemetryPID tracking ID for Scale
DefaultAzureStackScaleTelemetryPID = "pid-bbbafa53-d6a7-4022-84a2-86fcbaec7030"
// DefaultAzureStackUpgradeTelemetryPID tracking ID for Upgrade
DefaultAzureStackUpgradeTelemetryPID = "pid-0d9b5198-7cd7-4252-a890-5658eaf874be"
)

var (
//DefaultKubernetesSpecConfig is the default Docker image source of Kubernetes
DefaultKubernetesSpecConfig = KubernetesSpecConfig{
Expand Down
1 change: 1 addition & 0 deletions pkg/api/converterfromapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,7 @@ func convertAzureEnvironmentSpecConfigToVLabs(api *AzureEnvironmentSpecConfig, v
ResourceManagerVMDNSSuffix: api.EndpointConfig.ResourceManagerVMDNSSuffix,
}
vlabses.KubernetesSpecConfig = vlabs.KubernetesSpecConfig{
AzureTelemetryPID: api.KubernetesSpecConfig.AzureTelemetryPID,
KubernetesImageBase: api.KubernetesSpecConfig.KubernetesImageBase,
TillerImageBase: api.KubernetesSpecConfig.TillerImageBase,
ACIConnectorImageBase: api.KubernetesSpecConfig.ACIConnectorImageBase,
Expand Down
4 changes: 4 additions & 0 deletions pkg/api/converterfromapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ func TestConvertAzureEnvironmentSpecConfigToVLabs(t *testing.T) {
},
//KubernetesSpecConfig - Due to Chinese firewall issue, the default containers from google is blocked, use the Chinese local mirror instead
KubernetesSpecConfig: KubernetesSpecConfig{
AzureTelemetryPID: "AzureTelemetryPID",
KubernetesImageBase: "KubernetesImageBase",
TillerImageBase: "TillerImageBase",
ACIConnectorImageBase: "ACIConnectorImageBase",
Expand Down Expand Up @@ -213,6 +214,9 @@ func TestConvertAzureEnvironmentSpecConfigToVLabs(t *testing.T) {
}

//KubernetesSpecConfig
if vlabscsSpec.KubernetesSpecConfig.AzureTelemetryPID != csSpec.KubernetesSpecConfig.AzureTelemetryPID {
t.Errorf("incorrect AzureTelemetryPID, expect: '%s', actual: '%s'", csSpec.KubernetesSpecConfig.AzureTelemetryPID, vlabscsSpec.KubernetesSpecConfig.AzureTelemetryPID)
}
if vlabscsSpec.KubernetesSpecConfig.KubernetesImageBase != csSpec.KubernetesSpecConfig.KubernetesImageBase {
t.Errorf("incorrect KubernetesImageBase, expect: '%s', actual: '%s'", csSpec.KubernetesSpecConfig.KubernetesImageBase, vlabscsSpec.KubernetesSpecConfig.KubernetesImageBase)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/api/convertertoapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,7 @@ func convertAzureEnvironmentSpecConfig(vlabses *vlabs.AzureEnvironmentSpecConfig
ResourceManagerVMDNSSuffix: vlabses.EndpointConfig.ResourceManagerVMDNSSuffix,
}
api.KubernetesSpecConfig = KubernetesSpecConfig{
AzureTelemetryPID: vlabses.KubernetesSpecConfig.AzureTelemetryPID,
KubernetesImageBase: vlabses.KubernetesSpecConfig.KubernetesImageBase,
TillerImageBase: vlabses.KubernetesSpecConfig.TillerImageBase,
ACIConnectorImageBase: vlabses.KubernetesSpecConfig.ACIConnectorImageBase,
Expand Down
4 changes: 4 additions & 0 deletions pkg/api/convertertoapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ func TestConvertAzureEnvironmentSpecConfig(t *testing.T) {
},
//KubernetesSpecConfig - Due to Chinese firewall issue, the default containers from google is blocked, use the Chinese local mirror instead
KubernetesSpecConfig: vlabs.KubernetesSpecConfig{
AzureTelemetryPID: "AzureTelemetryPID",
KubernetesImageBase: "KubernetesImageBase",
TillerImageBase: "TillerImageBase",
ACIConnectorImageBase: "ACIConnectorImageBase",
Expand Down Expand Up @@ -432,6 +433,9 @@ func TestConvertAzureEnvironmentSpecConfig(t *testing.T) {
}

//KubernetesSpecConfig
if csSpec.KubernetesSpecConfig.AzureTelemetryPID != vlabscsSpec.KubernetesSpecConfig.AzureTelemetryPID {
t.Errorf("incorrect AzureTelemetryPID, expect: '%s', actual: '%s'", vlabscsSpec.KubernetesSpecConfig.AzureTelemetryPID, csSpec.KubernetesSpecConfig.AzureTelemetryPID)
}
if csSpec.KubernetesSpecConfig.KubernetesImageBase != vlabscsSpec.KubernetesSpecConfig.KubernetesImageBase {
t.Errorf("incorrect KubernetesImageBase, expect: '%s', actual: '%s'", vlabscsSpec.KubernetesSpecConfig.KubernetesImageBase, csSpec.KubernetesSpecConfig.KubernetesImageBase)
}
Expand Down
35 changes: 32 additions & 3 deletions pkg/api/defaults-custom-cloud-profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ import (
"github.com/pkg/errors"
)

func (cs *ContainerService) setCustomCloudProfileDefaults() error {
// CustomCloudProfileDefaultsParams is the parameters when we set the cloud profile defaults for ContainerService.
type CustomCloudProfileDefaultsParams struct {
IsUpgrade bool
IsScale bool
}

func (cs *ContainerService) setCustomCloudProfileDefaults(params CustomCloudProfileDefaultsParams) error {
p := cs.Properties
if p.IsAzureStackCloud() {
p.CustomCloudProfile.AuthenticationMethod = helpers.EnsureString(p.CustomCloudProfile.AuthenticationMethod, ClientSecretAuthMethod)
Expand All @@ -26,7 +32,7 @@ func (cs *ContainerService) setCustomCloudProfileDefaults() error {
if err != nil {
return fmt.Errorf("Failed to set environment - %s", err)
}
err = p.SetAzureStackCloudSpec()
err = p.SetAzureStackCloudSpec(AzureStackCloudSpecParams(params))
if err != nil {
return fmt.Errorf("Failed to set cloud spec - %s", err)
}
Expand Down Expand Up @@ -95,8 +101,14 @@ func (cs *ContainerService) SetCustomCloudProfileEnvironment() error {
return nil
}

// AzureStackCloudSpecParams is the parameters when we set the azure stack cloud spec defaults for ContainerService.
type AzureStackCloudSpecParams struct {
IsUpgrade bool
IsScale bool
}

// SetAzureStackCloudSpec sets the cloud spec for Azure Stack .
func (p *Properties) SetAzureStackCloudSpec() error {
func (p *Properties) SetAzureStackCloudSpec(params AzureStackCloudSpecParams) error {
if p.IsAzureStackCloud() {
var azureStackCloudSpec AzureEnvironmentSpecConfig
switch p.CustomCloudProfile.DependenciesLocation {
Expand All @@ -114,8 +126,23 @@ func (p *Properties) SetAzureStackCloudSpec() error {
if p.CustomCloudProfile.Environment == nil || p.CustomCloudProfile.Environment.ResourceManagerVMDNSSuffix == "" {
return errors.New("Failed to set Cloud Spec for Azure Stack due to invalid environment")
}

azureStackCloudSpec.EndpointConfig.ResourceManagerVMDNSSuffix = p.CustomCloudProfile.Environment.ResourceManagerVMDNSSuffix
azureStackCloudSpec.CloudName = AzureStackCloud

//Sets default values for telemetry PID where none is set
if p.CustomCloudProfile.AzureEnvironmentSpecConfig == nil {
switch {
case params.IsScale:
azureStackCloudSpec.KubernetesSpecConfig.AzureTelemetryPID = DefaultAzureStackScaleTelemetryPID
case params.IsUpgrade:
azureStackCloudSpec.KubernetesSpecConfig.AzureTelemetryPID = DefaultAzureStackUpgradeTelemetryPID
default:
azureStackCloudSpec.KubernetesSpecConfig.AzureTelemetryPID = DefaultAzureStackDeployTelemetryPID
}

}

// Use the custom input to overwrite the default values in AzureStackCloudSpec
if p.CustomCloudProfile.AzureEnvironmentSpecConfig != nil {
ascc := p.CustomCloudProfile.AzureEnvironmentSpecConfig
Expand All @@ -130,6 +157,8 @@ func (p *Properties) SetAzureStackCloudSpec() error {
//KubernetesSpecConfig
asccKubernetesSpecConfig := ascc.KubernetesSpecConfig
azsKubernetesSpecConfig := azureStackCloudSpec.KubernetesSpecConfig

azureStackCloudSpec.KubernetesSpecConfig.AzureTelemetryPID = helpers.EnsureString(asccKubernetesSpecConfig.AzureTelemetryPID, DefaultAzureStackDeployTelemetryPID)
azureStackCloudSpec.KubernetesSpecConfig.ACIConnectorImageBase = helpers.EnsureString(asccKubernetesSpecConfig.ACIConnectorImageBase, azsKubernetesSpecConfig.ACIConnectorImageBase)
azureStackCloudSpec.KubernetesSpecConfig.AzureCNIImageBase = helpers.EnsureString(asccKubernetesSpecConfig.AzureCNIImageBase, azsKubernetesSpecConfig.AzureCNIImageBase)
azureStackCloudSpec.KubernetesSpecConfig.CalicoImageBase = helpers.EnsureString(asccKubernetesSpecConfig.CalicoImageBase, azsKubernetesSpecConfig.CalicoImageBase)
Expand Down
5 changes: 4 additions & 1 deletion pkg/api/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ func (cs *ContainerService) SetPropertiesDefaults(params PropertiesDefaultsParam

// Set custom cloud profile defaults if this cluster configuration has custom cloud profile
if cs.Properties.CustomCloudProfile != nil {
err := cs.setCustomCloudProfileDefaults()
err := cs.setCustomCloudProfileDefaults(CustomCloudProfileDefaultsParams{
IsUpgrade: params.IsUpgrade,
IsScale: params.IsScale,
})
if err != nil {
return false, err
}
Expand Down
75 changes: 72 additions & 3 deletions pkg/api/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2213,6 +2213,7 @@ func TestSetCustomCloudProfileDefaults(t *testing.T) {
expectedEnv := AzureCloudSpecEnvMap[AzurePublicCloud]
expectedEnv.EndpointConfig.ResourceManagerVMDNSSuffix = mockCSPDefaultSpec.CustomCloudProfile.Environment.ResourceManagerVMDNSSuffix
expectedEnv.CloudName = AzureStackCloud
expectedEnv.KubernetesSpecConfig.AzureTelemetryPID = DefaultAzureStackDeployTelemetryPID
if diff := cmp.Diff(actualEnv, expectedEnv); diff != "" {
t.Errorf("setCustomCloudProfileDefaults(): did not set AzureStackCloudSpec as default when azureEnvironmentSpecConfig is empty in api model JSON file. %s", diff)
}
Expand Down Expand Up @@ -2240,6 +2241,7 @@ func TestSetCustomCloudProfileDefaults(t *testing.T) {
expectedEnvAzureChinaSpec := AzureCloudSpecEnvMap[value]
expectedEnvAzureChinaSpec.EndpointConfig.ResourceManagerVMDNSSuffix = mockCSPDefaultSpec.CustomCloudProfile.Environment.ResourceManagerVMDNSSuffix
expectedEnvAzureChinaSpec.CloudName = AzureStackCloud
expectedEnvAzureChinaSpec.KubernetesSpecConfig.AzureTelemetryPID = DefaultAzureStackDeployTelemetryPID
t.Logf("verifying dependenciesLocation: %s", key)
if diff := cmp.Diff(actualEnvAzureChinaSpec, expectedEnvAzureChinaSpec); diff != "" {
t.Errorf("setCustomCloudProfileDefaults(): did not set AzureStackCloudSpec as default when connection Mode is %s in api model JSON file. %s", key, diff)
Expand All @@ -2251,7 +2253,11 @@ func TestSetCustomCloudProfileDefaults(t *testing.T) {
mockCSPEmptyResourceManagerVMDNSSuffix := GetMockPropertiesWithCustomCloudProfile("azurestackcloud", true, true, false)
mockCSEmptyResourceManagerVMDNSSuffix.Properties.CustomCloudProfile = mockCSPEmptyResourceManagerVMDNSSuffix.CustomCloudProfile
mockCSEmptyResourceManagerVMDNSSuffix.Properties.CustomCloudProfile.Environment.ResourceManagerVMDNSSuffix = ""
acutalerr := mockCSEmptyResourceManagerVMDNSSuffix.Properties.SetAzureStackCloudSpec()

acutalerr := mockCSEmptyResourceManagerVMDNSSuffix.Properties.SetAzureStackCloudSpec(AzureStackCloudSpecParams{
IsUpgrade: false,
IsScale: false,
})
expectError := errors.New("Failed to set Cloud Spec for Azure Stack due to invalid environment")
if !helpers.EqualError(acutalerr, expectError) {
t.Errorf("verify ResourceManagerVMDNSSuffix empty: expected error: %s - got: %s", acutalerr, expectError)
Expand All @@ -2262,7 +2268,10 @@ func TestSetCustomCloudProfileDefaults(t *testing.T) {
mockCSPNilEnvironment := GetMockPropertiesWithCustomCloudProfile("azurestackcloud", true, true, false)
mockCSNilEnvironment.Properties.CustomCloudProfile = mockCSPNilEnvironment.CustomCloudProfile
mockCSNilEnvironment.Properties.CustomCloudProfile.Environment = nil
acutalerr = mockCSEmptyResourceManagerVMDNSSuffix.Properties.SetAzureStackCloudSpec()
acutalerr = mockCSEmptyResourceManagerVMDNSSuffix.Properties.SetAzureStackCloudSpec(AzureStackCloudSpecParams{
IsUpgrade: false,
IsScale: false,
})
if !helpers.EqualError(acutalerr, expectError) {
t.Errorf("verify environment nil: expected error: %s - got: %s", acutalerr, expectError)
}
Expand All @@ -2281,6 +2290,7 @@ func TestSetCustomCloudProfileDefaults(t *testing.T) {
},
//KubernetesSpecConfig - Due to Chinese firewall issue, the default containers from google is blocked, use the Chinese local mirror instead
KubernetesSpecConfig: KubernetesSpecConfig{
AzureTelemetryPID: "AzureTelemetryPID",
KubernetesImageBase: "KubernetesImageBase",
TillerImageBase: "TillerImageBase",
ACIConnectorImageBase: "ACIConnectorImageBase",
Expand Down Expand Up @@ -2383,7 +2393,6 @@ func TestSetCustomCloudProfileDefaults(t *testing.T) {
if mockCSCustomP.Properties.CustomCloudProfile.AzureEnvironmentSpecConfig.KubernetesSpecConfig.VnetCNIWindowsPluginsDownloadURL != DefaultKubernetesSpecConfig.VnetCNIWindowsPluginsDownloadURL {
t.Errorf("setCustomCloudProfileDefaults(): did not set VnetCNIWindowsPluginsDownloadURL with default Value, got '%s', expected %s", mockCSCustomP.Properties.CustomCloudProfile.AzureEnvironmentSpecConfig.KubernetesSpecConfig.VnetCNIWindowsPluginsDownloadURL, DefaultKubernetesSpecConfig.VnetCNIWindowsPluginsDownloadURL)
}

// Test that the default values are set for IdentitySystem and AuthenticationMethod if they are not in the configuration
mockCSAuth := getMockBaseContainerService("1.11.6")
mockCSPAuth := GetMockPropertiesWithCustomCloudProfile("azurestackcloud", true, true, true)
Expand Down Expand Up @@ -2542,6 +2551,7 @@ func TestSetCustomCloudProfileEnvironmentDefaults(t *testing.T) {

cloudSpec := AzureCloudSpecEnvMap[AzurePublicCloud]
cloudSpec.CloudName = AzureStackCloud
cloudSpec.KubernetesSpecConfig.AzureTelemetryPID = DefaultAzureStackDeployTelemetryPID
cloudSpec.EndpointConfig.ResourceManagerVMDNSSuffix = mockCS.Properties.CustomCloudProfile.Environment.ResourceManagerVMDNSSuffix
if diff := cmp.Diff(AzureCloudSpecEnvMap[AzureStackCloud], cloudSpec); diff != "" {
t.Errorf("Fail to compare, AzureCloudSpec AzureStackCloud %q", diff)
Expand Down Expand Up @@ -3311,3 +3321,62 @@ func TestEnableRBAC(t *testing.T) {
})
}
}

func TestDefaultTelemetry(t *testing.T) {
// Test that the AzureTelemetryPID is set to DefaultAzureStackDeployTelemetryPID by default
mockCSDefaultSpec := getMockBaseContainerService("1.11.6")
mockCSPDefaultSpec := GetMockPropertiesWithCustomCloudProfile("azurestackcloud", true, true, false)
mockCSDefaultSpec.Properties.CustomCloudProfile = mockCSPDefaultSpec.CustomCloudProfile
mockCSDefaultSpec.SetPropertiesDefaults(PropertiesDefaultsParams{
IsScale: false,
IsUpgrade: false,
PkiKeySize: helpers.DefaultPkiKeySize,
})

actualEnv := AzureCloudSpecEnvMap[AzureStackCloud]
expectedEnv := AzureCloudSpecEnvMap[AzurePublicCloud]
expectedEnv.EndpointConfig.ResourceManagerVMDNSSuffix = mockCSPDefaultSpec.CustomCloudProfile.Environment.ResourceManagerVMDNSSuffix
expectedEnv.CloudName = AzureStackCloud
expectedEnv.KubernetesSpecConfig.AzureTelemetryPID = DefaultAzureStackDeployTelemetryPID
if diff := cmp.Diff(actualEnv, expectedEnv); diff != "" {
t.Errorf("setCustomCloudProfileDefaults(): did not set AzureTelemetryPID as DefaultAzureStackDeployTelemetryPID. %s", diff)
}

// Test that the AzureTelemetryPID is set to DefaultAzureStackScaleTelemetryPID by in Scale scenario
mockCSScaleSpec := getMockBaseContainerService("1.11.6")
mockCSPScaleSpec := GetMockPropertiesWithCustomCloudProfile("azurestackcloud", true, true, false)
mockCSScaleSpec.Properties.CustomCloudProfile = mockCSPScaleSpec.CustomCloudProfile
mockCSScaleSpec.SetPropertiesDefaults(PropertiesDefaultsParams{
IsScale: true,
IsUpgrade: false,
PkiKeySize: helpers.DefaultPkiKeySize,
})

actualScaleEnv := AzureCloudSpecEnvMap[AzureStackCloud]
expectedScaleEnv := AzureCloudSpecEnvMap[AzurePublicCloud]
expectedScaleEnv.EndpointConfig.ResourceManagerVMDNSSuffix = mockCSPDefaultSpec.CustomCloudProfile.Environment.ResourceManagerVMDNSSuffix
expectedScaleEnv.CloudName = AzureStackCloud
expectedScaleEnv.KubernetesSpecConfig.AzureTelemetryPID = DefaultAzureStackScaleTelemetryPID
if diff := cmp.Diff(actualScaleEnv, expectedScaleEnv); diff != "" {
t.Errorf("setCustomCloudProfileDefaults(): did not set AzureTelemetryPID as DefaultAzureStackDeployTelemetryPID. %s", diff)
}

// Test that the AzureTelemetryPID is set to DefaultAzureStackUpgradeTelemetryPID in Upgrade scenario
mockCSSUpgradeSpec := getMockBaseContainerService("1.11.6")
mockCSPSUpgradeSpec := GetMockPropertiesWithCustomCloudProfile("azurestackcloud", true, true, false)
mockCSSUpgradeSpec.Properties.CustomCloudProfile = mockCSPSUpgradeSpec.CustomCloudProfile
mockCSSUpgradeSpec.SetPropertiesDefaults(PropertiesDefaultsParams{
IsScale: false,
IsUpgrade: true,
PkiKeySize: helpers.DefaultPkiKeySize,
})

actualSUpgradeEnv := AzureCloudSpecEnvMap[AzureStackCloud]
expectedSUpgradeEnv := AzureCloudSpecEnvMap[AzurePublicCloud]
expectedSUpgradeEnv.EndpointConfig.ResourceManagerVMDNSSuffix = mockCSPDefaultSpec.CustomCloudProfile.Environment.ResourceManagerVMDNSSuffix
expectedSUpgradeEnv.CloudName = AzureStackCloud
expectedSUpgradeEnv.KubernetesSpecConfig.AzureTelemetryPID = DefaultAzureStackUpgradeTelemetryPID
if diff := cmp.Diff(actualSUpgradeEnv, expectedSUpgradeEnv); diff != "" {
t.Errorf("setCustomCloudProfileDefaults(): did not set AzureTelemetryPID as DefaultAzureStackUpgradeTelemetryPID. %s", diff)
}
}
1 change: 1 addition & 0 deletions pkg/api/vlabs/azenvtypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type DCOSSpecConfig struct {

//KubernetesSpecConfig is the kubernetes container images used.
type KubernetesSpecConfig struct {
AzureTelemetryPID string `json:"azureTelemetryPID,omitempty"`
KubernetesImageBase string `json:"kubernetesImageBase,omitempty"`
TillerImageBase string `json:"tillerImageBase,omitempty"`
ACIConnectorImageBase string `json:"aciConnectorImageBase,omitempty"`
Expand Down
4 changes: 3 additions & 1 deletion pkg/engine/armresources.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ func GenerateARMResources(cs *api.ContainerService) []interface{} {
deploymentTelemetryEnabled := cs.Properties.FeatureFlags.IsFeatureEnabled("EnableTelemetry")
isAzureStack := cs.Properties.IsAzureStackCloud()

azureTelemetryPID := cs.GetCloudSpecConfig().KubernetesSpecConfig.AzureTelemetryPID

if deploymentTelemetryEnabled {
if isAzureStack {
deploymentResource := createAzurestackTelemetry()
deploymentResource := createAzureStackTelemetry(azureTelemetryPID)
armResources = append(armResources, deploymentResource)
}
}
Expand Down
Loading

0 comments on commit 966ac22

Please sign in to comment.