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

Commit

Permalink
use mcr repos and disable smb flexvol addon (#4266)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhangx authored and jackfrancis committed Nov 20, 2018
1 parent 8f52fde commit 675afe4
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 25 deletions.
4 changes: 2 additions & 2 deletions pkg/api/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (cs *ContainerService) setAddonsConfig(isUpdate bool) {
MemoryRequests: "10Mi",
CPULimits: "50m",
MemoryLimits: "10Mi",
Image: "andyzhangx/blobfuse-flexvol-installer",
Image: "mcr.microsoft.com/k8s/flexvolume/blobfuse-flexvolume",
},
},
}
Expand All @@ -95,7 +95,7 @@ func (cs *ContainerService) setAddonsConfig(isUpdate bool) {
MemoryRequests: "10Mi",
CPULimits: "50m",
MemoryLimits: "10Mi",
Image: "andyzhangx/smb-flexvol-installer",
Image: "mcr.microsoft.com/k8s/flexvolume/smb-flexvolume",
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const (
// DefaultBlobfuseFlexVolumeAddonEnabled determines the acs-engine provided default for enabling blobfuse flexvolume addon
DefaultBlobfuseFlexVolumeAddonEnabled = true
// DefaultSMBFlexVolumeAddonEnabled determines the acs-engine provided default for enabling smb flexvolume addon
DefaultSMBFlexVolumeAddonEnabled = true
DefaultSMBFlexVolumeAddonEnabled = false
// DefaultKeyVaultFlexVolumeAddonEnabled determines the acs-engine provided default for enabling key vault flexvolume addon
DefaultKeyVaultFlexVolumeAddonEnabled = true
// DefaultDashboardAddonEnabled determines the acs-engine provided default for enabling kubernetes-dashboard addon
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ func TestAssignDefaultAddonImages(t *testing.T) {
DefaultTillerAddonName: "gcr.io/kubernetes-helm/tiller:v2.8.1",
DefaultACIConnectorAddonName: "microsoft/virtual-kubelet:latest",
DefaultClusterAutoscalerAddonName: "k8s.gcr.io/cluster-autoscaler:v1.2.2",
DefaultBlobfuseFlexVolumeAddonName: "andyzhangx/blobfuse-flexvol-installer",
DefaultSMBFlexVolumeAddonName: "andyzhangx/smb-flexvol-installer",
DefaultBlobfuseFlexVolumeAddonName: "mcr.microsoft.com/k8s/flexvolume/blobfuse-flexvolume",
DefaultSMBFlexVolumeAddonName: "mcr.microsoft.com/k8s/flexvolume/smb-flexvolume",
DefaultKeyVaultFlexVolumeAddonName: "mcr.microsoft.com/k8s/flexvolume/keyvault-flexvolume:v0.0.5",
DefaultDashboardAddonName: "k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.0",
DefaultReschedulerAddonName: "k8s.gcr.io/rescheduler:v0.3.1",
Expand Down
159 changes: 139 additions & 20 deletions pkg/api/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,7 @@ func TestKubernetesAddon(t *testing.T) {
}

func TestIsTillerEnabled(t *testing.T) {
// Default case
c := KubernetesConfig{
Addons: []KubernetesAddon{
getMockAddon("addon"),
Expand All @@ -989,12 +990,28 @@ func TestIsTillerEnabled(t *testing.T) {
if enabled != enabledDefault {
t.Fatalf("KubernetesConfig.IsTillerEnabled() should return %t when no tiller addon has been specified, instead returned %t", enabledDefault, enabled)
}
// Addon present, but enabled not specified
c.Addons = append(c.Addons, getMockAddon(DefaultTillerAddonName))
enabled = c.IsTillerEnabled()
if enabled != enabledDefault {
t.Fatalf("KubernetesConfig.IsTillerEnabled() should return default when a custom tiller addon has been specified w/ no enabled value, expected %t, instead returned %t", enabledDefault, enabled)
}
// Addon present and enabled
b := true
c = KubernetesConfig{
Addons: []KubernetesAddon{
{
Name: DefaultTillerAddonName,
Enabled: &b,
},
},
}
enabled = c.IsTillerEnabled()
if !enabled {
t.Fatalf("KubernetesConfig.IsTillerEnabled() should return true when a custom tiller addon has been specified, instead returned %t", enabled)
t.Fatalf("KubernetesConfig.IsTillerEnabled() should return true when a custom tiller addon has been specified as enabled, instead returned %t", enabled)
}
b := false
// Addon present and disabled
b = false
c = KubernetesConfig{
Addons: []KubernetesAddon{
{
Expand All @@ -1010,6 +1027,7 @@ func TestIsTillerEnabled(t *testing.T) {
}

func TestIsAADPodIdentityEnabled(t *testing.T) {
// Default case
c := KubernetesConfig{
Addons: []KubernetesAddon{
getMockAddon("addon"),
Expand All @@ -1020,11 +1038,13 @@ func TestIsAADPodIdentityEnabled(t *testing.T) {
if enabled != enabledDefault {
t.Fatalf("KubernetesConfig.IsAADPodIdentityEnabled() should return %t when no aad pod identity addon has been specified, instead returned %t", enabledDefault, enabled)
}
// Addon present, but enabled not specified
c.Addons = append(c.Addons, getMockAddon(DefaultAADPodIdentityAddonName))
enabled = c.IsAADPodIdentityEnabled()
if enabled {
t.Fatalf("KubernetesConfig.IsAADPodIdentityEnabled() should return true when aad pod identity addon has been specified, instead returned %t", enabled)
if enabled != enabledDefault {
t.Fatalf("KubernetesConfig.IsAADPodIdentityEnabled() should return default when aad pod identity addon has been specified w/ no enabled value, expected %t, instead returned %t", enabledDefault, enabled)
}
// Addon present and enabled
b := true
c = KubernetesConfig{
Addons: []KubernetesAddon{
Expand All @@ -1036,11 +1056,26 @@ func TestIsAADPodIdentityEnabled(t *testing.T) {
}
enabled = c.IsAADPodIdentityEnabled()
if !enabled {
t.Fatalf("KubernetesConfig.IsAADPodIdentityEnabled() should return true when aad pod identity addon has been specified as enabled, instead returned %t", enabled)
}
// Addon present and disabled
b = false
c = KubernetesConfig{
Addons: []KubernetesAddon{
{
Name: DefaultAADPodIdentityAddonName,
Enabled: &b,
},
},
}
enabled = c.IsAADPodIdentityEnabled()
if enabled {
t.Fatalf("KubernetesConfig.IsAADPodIdentityEnabled() should return false when aad pod identity addon has been specified as disabled, instead returned %t", enabled)
}
}

func TestIsACIConnectorEnabled(t *testing.T) {
// Default case
c := KubernetesConfig{
Addons: []KubernetesAddon{
getMockAddon("addon"),
Expand All @@ -1051,11 +1086,13 @@ func TestIsACIConnectorEnabled(t *testing.T) {
if enabled != enabledDefault {
t.Fatalf("KubernetesConfig.IsACIConnectorEnabled() should return %t when no ACI connector addon has been specified, instead returned %t", enabledDefault, enabled)
}
// Addon present, but enabled not specified
c.Addons = append(c.Addons, getMockAddon(DefaultACIConnectorAddonName))
enabled = c.IsACIConnectorEnabled()
if enabled {
t.Fatalf("KubernetesConfig.IsACIConnectorEnabled() should return true when ACI connector has been specified, instead returned %t", enabled)
if enabled != enabledDefault {
t.Fatalf("KubernetesConfig.IsACIConnectorEnabled() should return default when ACI connector has been specified w/ no enabled value, expected %t, instead returned %t", enabledDefault, enabled)
}
// Addon present and enabled
b := true
c = KubernetesConfig{
Addons: []KubernetesAddon{
Expand All @@ -1067,11 +1104,26 @@ func TestIsACIConnectorEnabled(t *testing.T) {
}
enabled = c.IsACIConnectorEnabled()
if !enabled {
t.Fatalf("KubernetesConfig.IsACIConnectorEnabled() should return true when ACI connector addon has been specified as enabled, instead returned %t", enabled)
}
// Addon present and disabled
b = false
c = KubernetesConfig{
Addons: []KubernetesAddon{
{
Name: DefaultACIConnectorAddonName,
Enabled: &b,
},
},
}
enabled = c.IsACIConnectorEnabled()
if enabled {
t.Fatalf("KubernetesConfig.IsACIConnectorEnabled() should return false when ACI connector addon has been specified as disabled, instead returned %t", enabled)
}
}

func TestIsClusterAutoscalerEnabled(t *testing.T) {
// Default case
c := KubernetesConfig{
Addons: []KubernetesAddon{
getMockAddon("addon"),
Expand All @@ -1082,11 +1134,13 @@ func TestIsClusterAutoscalerEnabled(t *testing.T) {
if enabled != enabledDefault {
t.Fatalf("KubernetesConfig.IsClusterAutoscalerEnabled() should return %t when no cluster autoscaler addon has been specified, instead returned %t", enabledDefault, enabled)
}
// Addon present, but enabled not specified
c.Addons = append(c.Addons, getMockAddon(DefaultClusterAutoscalerAddonName))
enabled = c.IsClusterAutoscalerEnabled()
if enabled {
t.Fatalf("KubernetesConfig.IsClusterAutoscalerEnabled() should return true when cluster autoscaler has been specified, instead returned %t", enabled)
if enabled != enabledDefault {
t.Fatalf("KubernetesConfig.IsClusterAutoscalerEnabled() should return default when cluster autoscaler has been specified w/ no enabled value, expected %t, instead returned %t", enabledDefault, enabled)
}
// Addon present and enabled
b := true
c = KubernetesConfig{
Addons: []KubernetesAddon{
Expand All @@ -1098,11 +1152,26 @@ func TestIsClusterAutoscalerEnabled(t *testing.T) {
}
enabled = c.IsClusterAutoscalerEnabled()
if !enabled {
t.Fatalf("KubernetesConfig.IsClusterAutoscalerEnabled() should return true when cluster autoscaler addon has been specified as enabled, instead returned %t", enabled)
}
// Addon present and disabled
b = false
c = KubernetesConfig{
Addons: []KubernetesAddon{
{
Name: DefaultClusterAutoscalerAddonName,
Enabled: &b,
},
},
}
enabled = c.IsClusterAutoscalerEnabled()
if enabled {
t.Fatalf("KubernetesConfig.IsClusterAutoscalerEnabled() should return false when cluster autoscaler addon has been specified as disabled, instead returned %t", enabled)
}
}

func TestIsBlobfuseFlexVolumeEnabled(t *testing.T) {
// Default case
c := KubernetesConfig{
Addons: []KubernetesAddon{
getMockAddon("addon"),
Expand All @@ -1111,13 +1180,15 @@ func TestIsBlobfuseFlexVolumeEnabled(t *testing.T) {
enabled := c.IsBlobfuseFlexVolumeEnabled()
enabledDefault := DefaultBlobfuseFlexVolumeAddonEnabled
if enabled != enabledDefault {
t.Fatalf("KubernetesConfig.IsBlobfuseFlexVolumeEnabled() should return %t when no blob fuse flex volume addon has been specified, instead returned %t", enabledDefault, enabled)
t.Fatalf("KubernetesConfig.IsBlobfuseFlexVolumeEnabled() should return %t when no blobfuse flexvolume addon has been specified, instead returned %t", enabledDefault, enabled)
}
// Addon present, but enabled not specified
c.Addons = append(c.Addons, getMockAddon(DefaultBlobfuseFlexVolumeAddonName))
enabled = c.IsBlobfuseFlexVolumeEnabled()
if !enabled {
t.Fatalf("KubernetesConfig.IsBlobfuseFlexVolumeEnabled() should return true when blob fuse flex volume has been specified, instead returned %t", enabled)
if enabled != enabledDefault {
t.Fatalf("KubernetesConfig.IsBlobfuseFlexVolumeEnabled() should return default when blobfuse flexvolume has been specified w/ no enabled value, expected %t, instead returned %t", enabledDefault, enabled)
}
// Addon present and enabled
b := true
c = KubernetesConfig{
Addons: []KubernetesAddon{
Expand All @@ -1129,11 +1200,26 @@ func TestIsBlobfuseFlexVolumeEnabled(t *testing.T) {
}
enabled = c.IsBlobfuseFlexVolumeEnabled()
if !enabled {
t.Fatalf("KubernetesConfig.IsBlobfuseFlexVolumeEnabled() should return false when blob fuse flex volume addon has been specified as disabled, instead returned %t", enabled)
t.Fatalf("KubernetesConfig.IsBlobfuseFlexVolumeEnabled() should return true when blobfuse flexvolume addon has been specified as enabled, instead returned %t", enabled)
}
// Addon present and disabled
b = false
c = KubernetesConfig{
Addons: []KubernetesAddon{
{
Name: DefaultBlobfuseFlexVolumeAddonName,
Enabled: &b,
},
},
}
enabled = c.IsBlobfuseFlexVolumeEnabled()
if enabled {
t.Fatalf("KubernetesConfig.IsBlobfuseFlexVolumeEnabled() should return false when blobfuse flexvolume addon has been specified as disabled, instead returned %t", enabled)
}
}

func TestIsSMBFlexVolumeEnabled(t *testing.T) {
// Default case
c := KubernetesConfig{
Addons: []KubernetesAddon{
getMockAddon("addon"),
Expand All @@ -1142,13 +1228,15 @@ func TestIsSMBFlexVolumeEnabled(t *testing.T) {
enabled := c.IsSMBFlexVolumeEnabled()
enabledDefault := DefaultSMBFlexVolumeAddonEnabled
if enabled != enabledDefault {
t.Fatalf("KubernetesConfig.IsSMBFlexVolumeEnabled() should return %t when no SMB flex volume addon has been specified, instead returned %t", enabledDefault, enabled)
t.Fatalf("KubernetesConfig.IsSMBFlexVolumeEnabled() should return %t when no SMB flexvolume addon has been specified, instead returned %t", enabledDefault, enabled)
}
// Addon present, but enabled not specified
c.Addons = append(c.Addons, getMockAddon(DefaultSMBFlexVolumeAddonName))
enabled = c.IsSMBFlexVolumeEnabled()
if !enabled {
t.Fatalf("KubernetesConfig.IsSMBFlexVolumeEnabled() should return true when SMB flex volume has been specified, instead returned %t", enabled)
if enabled != enabledDefault {
t.Fatalf("KubernetesConfig.IsSMBFlexVolumeEnabled() should return default when SMB flexvolume has been specified w/ no enabled value, expected %t, instead returned %t", enabledDefault, enabled)
}
// Addon present and enabled
b := true
c = KubernetesConfig{
Addons: []KubernetesAddon{
Expand All @@ -1160,11 +1248,26 @@ func TestIsSMBFlexVolumeEnabled(t *testing.T) {
}
enabled = c.IsSMBFlexVolumeEnabled()
if !enabled {
t.Fatalf("KubernetesConfig.IsSMBFlexVolumeEnabled() should return false when SMB flex volume addon has been specified as disabled, instead returned %t", enabled)
t.Fatalf("KubernetesConfig.IsSMBFlexVolumeEnabled() should return true when SMB flexvolume addon has been specified as enabled, instead returned %t", enabled)
}
// Addon present and disabled
b = false
c = KubernetesConfig{
Addons: []KubernetesAddon{
{
Name: DefaultSMBFlexVolumeAddonName,
Enabled: &b,
},
},
}
enabled = c.IsSMBFlexVolumeEnabled()
if enabled {
t.Fatalf("KubernetesConfig.IsSMBFlexVolumeEnabled() should return true when SMB flexvolume addon has been specified as enabled, instead returned %t", enabled)
}
}

func TestIsKeyVaultFlexVolumeEnabled(t *testing.T) {
// Default case
c := KubernetesConfig{
Addons: []KubernetesAddon{
getMockAddon("addon"),
Expand All @@ -1173,14 +1276,30 @@ func TestIsKeyVaultFlexVolumeEnabled(t *testing.T) {
enabled := c.IsKeyVaultFlexVolumeEnabled()
enabledDefault := DefaultKeyVaultFlexVolumeAddonEnabled
if enabled != enabledDefault {
t.Fatalf("KubernetesConfig.IsKeyVaultFlexVolumeEnabled() should return %t when no key vault flex volume addon has been specified, instead returned %t", enabledDefault, enabled)
t.Fatalf("KubernetesConfig.IsKeyVaultFlexVolumeEnabled() should return %t when no key vault flexvolume addon has been specified, instead returned %t", enabledDefault, enabled)
}
// Addon present, but enabled not specified
c.Addons = append(c.Addons, getMockAddon(DefaultKeyVaultFlexVolumeAddonName))
enabled = c.IsKeyVaultFlexVolumeEnabled()
if enabled != enabledDefault {
t.Fatalf("KubernetesConfig.IsKeyVaultFlexVolumeEnabled() should return default when no keyvault flexvolume has been specified w/ no enabled value, expected %t, instead returned %t", enabledDefault, enabled)
}
// Addon present and enabled
b := true
c = KubernetesConfig{
Addons: []KubernetesAddon{
{
Name: DefaultKeyVaultFlexVolumeAddonName,
Enabled: &b,
},
},
}
enabled = c.IsKeyVaultFlexVolumeEnabled()
if !enabled {
t.Fatalf("KubernetesConfig.IsKeyVaultFlexVolumeEnabled() should return true when no keyvault flex volume has been specified, instead returned %t", enabled)
t.Fatalf("KubernetesConfig.IsKeyVaultFlexVolumeEnabled() should return true when keyvault flexvolume addon has been specified as enabled, instead returned %t", enabled)
}
b := false
// Addon present and disabled
b = false
c = KubernetesConfig{
Addons: []KubernetesAddon{
{
Expand All @@ -1191,7 +1310,7 @@ func TestIsKeyVaultFlexVolumeEnabled(t *testing.T) {
}
enabled = c.IsKeyVaultFlexVolumeEnabled()
if enabled {
t.Fatalf("KubernetesConfig.IsKeyVaultFlexVolumeEnabled() should return false when keyvault flex volume addon has been specified as disabled, instead returned %t", enabled)
t.Fatalf("KubernetesConfig.IsKeyVaultFlexVolumeEnabled() should return false when keyvault flexvolume addon has been specified as disabled, instead returned %t", enabled)
}
}

Expand Down

0 comments on commit 675afe4

Please sign in to comment.