From 95398ac0f66f8f97f4899aa77fd08a7284e1117a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Erbrech?= Date: Wed, 27 Feb 2019 12:45:08 -0800 Subject: [PATCH] chore: change vmss casing across code base (#602) --- cmd/scale.go | 2 +- pkg/api/defaults_test.go | 18 +++++++++--------- pkg/api/vlabs/types_test.go | 2 +- pkg/api/vlabs/validate_test.go | 4 ++-- pkg/armhelpers/compute.go | 2 +- pkg/armhelpers/utils/util_test.go | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cmd/scale.go b/cmd/scale.go index ad4bb7827d5..f38ff9cfc6c 100644 --- a/cmd/scale.go +++ b/cmd/scale.go @@ -301,7 +301,7 @@ func (sc *scaleCmd) run(cmd *cobra.Command, args []string) error { } else { for vmssListPage, err := sc.client.ListVirtualMachineScaleSets(ctx, sc.resourceGroupName); vmssListPage.NotDone(); err = vmssListPage.NextWithContext(ctx) { if err != nil { - return errors.Wrap(err, "failed to get vmss list in the resource group") + return errors.Wrap(err, "failed to get VMSS list in the resource group") } for _, vmss := range vmssListPage.Values() { vmName := *vmss.Name diff --git a/pkg/api/defaults_test.go b/pkg/api/defaults_test.go index f520d3356d8..8d53787e792 100644 --- a/pkg/api/defaults_test.go +++ b/pkg/api/defaults_test.go @@ -401,11 +401,11 @@ func TestAcceleratedNetworking(t *testing.T) { isScale := true mockCS.SetPropertiesDefaults(false, isScale) - // In scale scenario, nil AcceleratedNetworkingEnabled should always render as false (i.e., we never turn on this feature on an existing agent pool / vmss that didn't have it before) + // In scale scenario, nil AcceleratedNetworkingEnabled should always render as false (i.e., we never turn on this feature on an existing agent pool / VMSS that didn't have it before) if to.Bool(mockCS.Properties.AgentPoolProfiles[0].AcceleratedNetworkingEnabled) { t.Errorf("expected nil acceleratedNetworkingEnabled to be false after upgrade, instead got %t", to.Bool(mockCS.Properties.AgentPoolProfiles[0].AcceleratedNetworkingEnabled)) } - // In scale scenario, nil AcceleratedNetworkingEnabledWindows should always render as false (i.e., we never turn on this feature on an existing vm that didn't have it before) + // In scale scenario, nil AcceleratedNetworkingEnabledWindows should always render as false (i.e., we never turn on this feature on an existing VM that didn't have it before) if to.Bool(mockCS.Properties.AgentPoolProfiles[0].AcceleratedNetworkingEnabledWindows) { t.Errorf("expected nil acceleratedNetworkingEnabledWindows to be false after upgrade, instead got %t", to.Bool(mockCS.Properties.AgentPoolProfiles[0].AcceleratedNetworkingEnabledWindows)) } @@ -467,7 +467,7 @@ func TestVMSSOverProvisioning(t *testing.T) { isScale := true mockCS.SetPropertiesDefaults(false, isScale) - // In scale scenario, nil VMSSOverProvisioningEnabled should always render as false (i.e., we never turn on this feature on an existing agent pool / vmss that didn't have it before) + // In scale scenario, nil VMSSOverProvisioningEnabled should always render as false (i.e., we never turn on this feature on an existing agent pool / VMSS that didn't have it before) if to.Bool(mockCS.Properties.AgentPoolProfiles[0].VMSSOverProvisioningEnabled) { t.Errorf("expected nil VMSSOverProvisioningEnabled to be false after upgrade, instead got %t", to.Bool(mockCS.Properties.AgentPoolProfiles[0].VMSSOverProvisioningEnabled)) } @@ -846,7 +846,7 @@ func TestMasterProfileDefaults(t *testing.T) { properties.MasterProfile.FirstConsecutiveStaticIP, "10.255.255.5") } - // this validates default vmss masterProfile configuration + // this validates default VMSS masterProfile configuration mockCS = getMockBaseContainerService("1.10.3") properties = mockCS.Properties properties.OrchestratorProfile.OrchestratorType = "Kubernetes" @@ -922,7 +922,7 @@ func TestMasterProfileDefaults(t *testing.T) { properties.MasterProfile.FirstConsecutiveStaticIP, "10.239.255.239") } - // this validates default vmss masterProfile configuration, AzureCNI, and custom vnet + // this validates default VMSS masterProfile configuration, AzureCNI, and custom VNET mockCS = getMockBaseContainerService("1.10.3") properties = mockCS.Properties properties.OrchestratorProfile.OrchestratorType = "Kubernetes" @@ -1079,7 +1079,7 @@ func TestIsAzureCNINetworkmonitorAddon(t *testing.T) { // TestSetVMSSDefaultsAndZones covers tests for setVMSSDefaultsForAgents and masters func TestSetVMSSDefaultsAndZones(t *testing.T) { - // masters with vmss and no zones + // masters with VMSS and no zones mockCS := getMockBaseContainerService("1.12.0") properties := mockCS.Properties properties.OrchestratorProfile.OrchestratorType = "Kubernetes" @@ -1093,7 +1093,7 @@ func TestSetVMSSDefaultsAndZones(t *testing.T) { t.Fatalf("OrchestratorProfile.KubernetesConfig.LoadBalancerSku did not have the expected configuration, got %s, expected %s", properties.OrchestratorProfile.KubernetesConfig.LoadBalancerSku, DefaultLoadBalancerSku) } - // masters with vmss and zones + // masters with VMSS and zones mockCS = getMockBaseContainerService("1.12.0") properties = mockCS.Properties properties.OrchestratorProfile.OrchestratorType = "Kubernetes" @@ -1118,7 +1118,7 @@ func TestSetVMSSDefaultsAndZones(t *testing.T) { t.Fatalf("OrchestratorProfile.KubernetesConfig.ExcludeMasterFromStandardLB did not have the expected configuration, got %t, expected %t", *properties.OrchestratorProfile.KubernetesConfig.ExcludeMasterFromStandardLB, excludeMaster) } - // agents with vmss and no zones + // agents with VMSS and no zones mockCS = getMockBaseContainerService("1.12.0") properties = mockCS.Properties properties.OrchestratorProfile.OrchestratorType = "Kubernetes" @@ -1132,7 +1132,7 @@ func TestSetVMSSDefaultsAndZones(t *testing.T) { t.Fatalf("OrchestratorProfile.KubernetesConfig.LoadBalancerSku did not have the expected configuration, got %s, expected %s", properties.OrchestratorProfile.KubernetesConfig.LoadBalancerSku, DefaultLoadBalancerSku) } - // agents with vmss and zones + // agents with VMSS and zones mockCS = getMockBaseContainerService("1.12.0") properties = mockCS.Properties properties.OrchestratorProfile.OrchestratorType = "Kubernetes" diff --git a/pkg/api/vlabs/types_test.go b/pkg/api/vlabs/types_test.go index 7e92537564f..fe52e39f99a 100644 --- a/pkg/api/vlabs/types_test.go +++ b/pkg/api/vlabs/types_test.go @@ -126,7 +126,7 @@ func TestMasterProfile(t *testing.T) { t.Fatalf("unexpectedly detected MasterProfile.AvailabilitySets == VirtualMachineScaleSets after unmarshal") } - // With vmss and zones + // With VMSS and zones MasterProfileText = `{ "count": 3, "vmSize": "Standard_D2_v2", "availabilityProfile": "VirtualMachineScaleSets", "storageProfile" : "ManagedDisks", "diskSizesGB" : [750, 250, 600, 1000], "AvailabilityZones": ["1","2"] }` mp = &MasterProfile{} if e := json.Unmarshal([]byte(MasterProfileText), mp); e != nil { diff --git a/pkg/api/vlabs/validate_test.go b/pkg/api/vlabs/validate_test.go index 5b69b8ccfa3..403ded6f85d 100644 --- a/pkg/api/vlabs/validate_test.go +++ b/pkg/api/vlabs/validate_test.go @@ -1446,7 +1446,7 @@ func TestProperties_ValidateManagedIdentity(t *testing.T) { agentPoolProfiles []*AgentPoolProfile }{ { - name: "use managed identity with master vmss", + name: "use managed identity with master VMSS", orchestratorRelease: "1.11", useManagedIdentity: true, userAssignedID: "utaksenginetestid", @@ -1500,7 +1500,7 @@ func TestProperties_ValidateManagedIdentity(t *testing.T) { expectedErr: "user assigned identity can only be used with Kubernetes 1.12.0 or above. Please specify \"orchestratorRelease\": \"1.12\"", }, { - name: "user master vmss with empty user assigned ID", + name: "user master VMSS with empty user assigned ID", orchestratorRelease: "1.12", useManagedIdentity: true, masterProfile: MasterProfile{ diff --git a/pkg/armhelpers/compute.go b/pkg/armhelpers/compute.go index a51f4235079..ed8777a3029 100644 --- a/pkg/armhelpers/compute.go +++ b/pkg/armhelpers/compute.go @@ -35,7 +35,7 @@ func (az *AzureClient) DeleteVirtualMachine(ctx context.Context, resourceGroup, return err } -// ListVirtualMachineScaleSets returns (the first page of) the vmss resources in the specified resource group. +// ListVirtualMachineScaleSets returns (the first page of) the VMSS resources in the specified resource group. func (az *AzureClient) ListVirtualMachineScaleSets(ctx context.Context, resourceGroup string) (VirtualMachineScaleSetListResultPage, error) { page, err := az.virtualMachineScaleSetsClient.List(ctx, resourceGroup) return &page, err diff --git a/pkg/armhelpers/utils/util_test.go b/pkg/armhelpers/utils/util_test.go index 27f423ea4d4..8d26334dfed 100644 --- a/pkg/armhelpers/utils/util_test.go +++ b/pkg/armhelpers/utils/util_test.go @@ -58,7 +58,7 @@ func Test_LinuxVMNameParts(t *testing.T) { } } -func Test_VmssNameParts(t *testing.T) { +func Test_VMSSNameParts(t *testing.T) { data := []struct { poolIdentifier, nameSuffix string }{