Skip to content

Commit ecdc1ba

Browse files
committed
Fix a lot of typos in Azure codes
1 parent 16e18a5 commit ecdc1ba

29 files changed

+95
-95
lines changed

staging/src/k8s.io/legacy-cloud-providers/azure/auth/azure_auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ func GetNetworkResourceServicePrincipalToken(config *AzureAuthConfig, env *azure
213213
}
214214

215215
// ParseAzureEnvironment returns the azure environment.
216-
// If 'resourceManagerEndpoint' is set, the environment is computed by quering the cloud's resource manager endpoint.
216+
// If 'resourceManagerEndpoint' is set, the environment is computed by querying the cloud's resource manager endpoint.
217217
// Otherwise, a pre-defined Environment is looked up by name.
218218
func ParseAzureEnvironment(cloudName, resourceManagerEndpoint, identitySystem string) (*azure.Environment, error) {
219219
var env azure.Environment

staging/src/k8s.io/legacy-cloud-providers/azure/auth/azure_auth_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ func TestGetNetworkResourceServicePrincipalTokenNegative(t *testing.T) {
192192
}
193193
}
194194

195-
func TestParseAzureEngironment(t *testing.T) {
195+
func TestParseAzureEnvironment(t *testing.T) {
196196
cases := []struct {
197197
cloudName string
198198
resourceManagerEndpoint string

staging/src/k8s.io/legacy-cloud-providers/azure/azure.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ const (
9696
const (
9797
// PreConfiguredBackendPoolLoadBalancerTypesNone means that the load balancers are not pre-configured
9898
PreConfiguredBackendPoolLoadBalancerTypesNone = ""
99-
// PreConfiguredBackendPoolLoadBalancerTypesInteral means that the `internal` load balancers are pre-configured
100-
PreConfiguredBackendPoolLoadBalancerTypesInteral = "internal"
99+
// PreConfiguredBackendPoolLoadBalancerTypesInternal means that the `internal` load balancers are pre-configured
100+
PreConfiguredBackendPoolLoadBalancerTypesInternal = "internal"
101101
// PreConfiguredBackendPoolLoadBalancerTypesExternal means that the `external` load balancers are pre-configured
102102
PreConfiguredBackendPoolLoadBalancerTypesExternal = "external"
103103
// PreConfiguredBackendPoolLoadBalancerTypesAll means that all load balancers are pre-configured
@@ -383,7 +383,7 @@ func (az *Cloud) InitializeCloudFromConfig(config *Config, fromSecret bool) erro
383383
if err == auth.ErrorNoAuth {
384384
// Only controller-manager would lazy-initialize from secret, and credentials are required for such case.
385385
if fromSecret {
386-
err := fmt.Errorf("No credentials provided for Azure cloud provider")
386+
err := fmt.Errorf("no credentials provided for Azure cloud provider")
387387
klog.Fatalf("%v", err)
388388
return err
389389
}
@@ -810,7 +810,7 @@ func (az *Cloud) updateNodeCaches(prevNode, newNode *v1.Node) {
810810
// GetActiveZones returns all the zones in which k8s nodes are currently running.
811811
func (az *Cloud) GetActiveZones() (sets.String, error) {
812812
if az.nodeInformerSynced == nil {
813-
return nil, fmt.Errorf("Azure cloud provider doesn't have informers set")
813+
return nil, fmt.Errorf("azure cloud provider doesn't have informers set")
814814
}
815815

816816
az.nodeCachesLock.RLock()

staging/src/k8s.io/legacy-cloud-providers/azure/azure_backoff.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ func (az *Cloud) RequestBackoff() (resourceRequestBackoff wait.Backoff) {
6868
}
6969

7070
// Event creates a event for the specified object.
71-
func (az *Cloud) Event(obj runtime.Object, eventtype, reason, message string) {
71+
func (az *Cloud) Event(obj runtime.Object, eventType, reason, message string) {
7272
if obj != nil && reason != "" {
73-
az.eventRecorder.Event(obj, eventtype, reason, message)
73+
az.eventRecorder.Event(obj, eventType, reason, message)
7474
}
7575
}
7676

@@ -359,7 +359,7 @@ func (az *Cloud) CreateOrUpdateRouteTable(routeTable network.RouteTable) error {
359359
}
360360
// Invalidate the cache because another new operation has canceled the current request.
361361
if strings.Contains(strings.ToLower(rerr.Error().Error()), operationCanceledErrorMessage) {
362-
klog.V(3).Infof("Route table cache for %s is cleanup because CreateOrUpdateRouteTable is canceld by another operation", *routeTable.Name)
362+
klog.V(3).Infof("Route table cache for %s is cleanup because CreateOrUpdateRouteTable is canceled by another operation", *routeTable.Name)
363363
az.rtCache.Delete(*routeTable.Name)
364364
}
365365
klog.Errorf("RouteTablesClient.CreateOrUpdate(%s) failed: %v", az.RouteTableName, rerr.Error())
@@ -384,7 +384,7 @@ func (az *Cloud) CreateOrUpdateRoute(route network.Route) error {
384384
}
385385
// Invalidate the cache because another new operation has canceled the current request.
386386
if strings.Contains(strings.ToLower(rerr.Error().Error()), operationCanceledErrorMessage) {
387-
klog.V(3).Infof("Route cache for %s is cleanup because CreateOrUpdateRouteTable is canceld by another operation", *route.Name)
387+
klog.V(3).Infof("Route cache for %s is cleanup because CreateOrUpdateRouteTable is canceled by another operation", *route.Name)
388388
az.rtCache.Delete(az.RouteTableName)
389389
}
390390
return rerr.Error()

staging/src/k8s.io/legacy-cloud-providers/azure/azure_blobDiskController.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ func (c *BlobDiskController) CreateBlobDisk(dataDiskName string, storageAccountT
254254

255255
//DeleteBlobDisk : delete a blob disk from a node
256256
func (c *BlobDiskController) DeleteBlobDisk(diskURI string) error {
257-
storageAccountName, vhdName, err := diskNameandSANameFromURI(diskURI)
257+
storageAccountName, vhdName, err := diskNameAndSANameFromURI(diskURI)
258258
if err != nil {
259259
return err
260260
}
@@ -468,13 +468,13 @@ func (c *BlobDiskController) getAllStorageAccounts() (map[string]*storageAccount
468468
}
469469
klog.Infof("azureDisk - identified account %s as part of shared PVC accounts", *v.Name)
470470

471-
sastate := &storageAccountState{
471+
saState := &storageAccountState{
472472
name: *v.Name,
473473
saType: (*v.Sku).Name,
474474
diskCount: -1,
475475
}
476476

477-
accounts[*v.Name] = sastate
477+
accounts[*v.Name] = saState
478478
}
479479

480480
return accounts, nil
@@ -578,7 +578,7 @@ func (c *BlobDiskController) findSANameForDisk(storageAccountType storage.SkuNam
578578
disksAfter := totalDiskCounts + 1 // with the new one!
579579

580580
avgUtilization := float64(disksAfter) / float64(countAccounts*maxDisksPerStorageAccounts)
581-
aboveAvg := (avgUtilization > storageAccountUtilizationBeforeGrowing)
581+
aboveAvg := avgUtilization > storageAccountUtilizationBeforeGrowing
582582

583583
// avg are not create and we should create more accounts if we can
584584
if aboveAvg && countAccounts < maxStorageAccounts {
@@ -631,7 +631,7 @@ func createVHDHeader(size uint64) ([]byte, error) {
631631
return b.Bytes(), nil
632632
}
633633

634-
func diskNameandSANameFromURI(diskURI string) (string, string, error) {
634+
func diskNameAndSANameFromURI(diskURI string) (string, string, error) {
635635
uri, err := url.Parse(diskURI)
636636
if err != nil {
637637
return "", "", err

staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ func TestCommonDetachDisk(t *testing.T) {
294294
expectedErr: false,
295295
},
296296
{
297-
desc: "no error shall be returned if the disk exsists",
297+
desc: "no error shall be returned if the disk exists",
298298
vmList: map[string]string{"vm1": "PowerState/Running"},
299299
nodeName: "vm1",
300300
diskName: "disk1",

staging/src/k8s.io/legacy-cloud-providers/azure/azure_instance_metadata.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func (ims *InstanceMetadataService) GetMetadata(crt azcache.AzureCacheReadType)
153153
return nil, err
154154
}
155155

156-
// Cache shouldn't be nil, but added a check incase something wrong.
156+
// Cache shouldn't be nil, but added a check in case something is wrong.
157157
if cache == nil {
158158
return nil, fmt.Errorf("failure of getting instance metadata")
159159
}

staging/src/k8s.io/legacy-cloud-providers/azure/azure_instances.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ func (az *Cloud) isCurrentInstance(name types.NodeName, metadataVMName string) (
258258
}
259259

260260
metadataVMName = strings.ToLower(metadataVMName)
261-
return (metadataVMName == nodeName), nil
261+
return metadataVMName == nodeName, nil
262262
}
263263

264264
// InstanceID returns the cloud provider ID of the specified instance.

staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,7 @@ func (az *Cloud) reconcileSecurityGroup(clusterName string, service *v1.Service,
16091609
if ports == nil {
16101610
if useSharedSecurityRule(service) {
16111611
klog.V(2).Infof("Attempting to reconcile security group for service %s, but service uses shared rule and we don't know which port it's for", service.Name)
1612-
return nil, fmt.Errorf("No port info for reconciling shared rule for service %s", service.Name)
1612+
return nil, fmt.Errorf("no port info for reconciling shared rule for service %s", service.Name)
16131613
}
16141614
ports = []v1.ServicePort{}
16151615
}
@@ -1621,7 +1621,7 @@ func (az *Cloud) reconcileSecurityGroup(clusterName string, service *v1.Service,
16211621

16221622
destinationIPAddress := ""
16231623
if wantLb && lbIP == nil {
1624-
return nil, fmt.Errorf("No load balancer IP for setting up security rules for service %s", service.Name)
1624+
return nil, fmt.Errorf("no load balancer IP for setting up security rules for service %s", service.Name)
16251625
}
16261626
if lbIP != nil {
16271627
destinationIPAddress = *lbIP
@@ -1724,17 +1724,17 @@ func (az *Cloud) reconcileSecurityGroup(clusterName string, service *v1.Service,
17241724
sharedIndex, sharedRule, sharedRuleFound := findSecurityRuleByName(updatedRules, sharedRuleName)
17251725
if !sharedRuleFound {
17261726
klog.V(4).Infof("Expected to find shared rule %s for service %s being deleted, but did not", sharedRuleName, service.Name)
1727-
return nil, fmt.Errorf("Expected to find shared rule %s for service %s being deleted, but did not", sharedRuleName, service.Name)
1727+
return nil, fmt.Errorf("expected to find shared rule %s for service %s being deleted, but did not", sharedRuleName, service.Name)
17281728
}
17291729
if sharedRule.DestinationAddressPrefixes == nil {
17301730
klog.V(4).Infof("Expected to have array of destinations in shared rule for service %s being deleted, but did not", service.Name)
1731-
return nil, fmt.Errorf("Expected to have array of destinations in shared rule for service %s being deleted, but did not", service.Name)
1731+
return nil, fmt.Errorf("expected to have array of destinations in shared rule for service %s being deleted, but did not", service.Name)
17321732
}
17331733
existingPrefixes := *sharedRule.DestinationAddressPrefixes
17341734
addressIndex, found := findIndex(existingPrefixes, destinationIPAddress)
17351735
if !found {
17361736
klog.V(4).Infof("Expected to find destination address %s in shared rule %s for service %s being deleted, but did not", destinationIPAddress, sharedRuleName, service.Name)
1737-
return nil, fmt.Errorf("Expected to find destination address %s in shared rule %s for service %s being deleted, but did not", destinationIPAddress, sharedRuleName, service.Name)
1737+
return nil, fmt.Errorf("expected to find destination address %s in shared rule %s for service %s being deleted, but did not", destinationIPAddress, sharedRuleName, service.Name)
17381738
}
17391739
if len(existingPrefixes) == 1 {
17401740
updatedRules = append(updatedRules[:sharedIndex], updatedRules[sharedIndex+1:]...)
@@ -2282,7 +2282,7 @@ func (az *Cloud) isBackendPoolPreConfigured(service *v1.Service) bool {
22822282
if az.PreConfiguredBackendPoolLoadBalancerTypes == PreConfiguredBackendPoolLoadBalancerTypesAll {
22832283
preConfigured = true
22842284
}
2285-
if (az.PreConfiguredBackendPoolLoadBalancerTypes == PreConfiguredBackendPoolLoadBalancerTypesInteral) && isInternal {
2285+
if (az.PreConfiguredBackendPoolLoadBalancerTypes == PreConfiguredBackendPoolLoadBalancerTypesInternal) && isInternal {
22862286
preConfigured = true
22872287
}
22882288
if (az.PreConfiguredBackendPoolLoadBalancerTypes == PreConfiguredBackendPoolLoadBalancerTypesExternal) && !isInternal {

staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func TestFindProbe(t *testing.T) {
5656
expected: false,
5757
},
5858
{
59-
msg: "probe names match while ports unmatch should return false",
59+
msg: "probe names match while ports don't should return false",
6060
existingProbe: []network.Probe{
6161
{
6262
Name: to.StringPtr("httpProbe"),
@@ -74,7 +74,7 @@ func TestFindProbe(t *testing.T) {
7474
expected: false,
7575
},
7676
{
77-
msg: "probe ports match while names unmatch should return false",
77+
msg: "probe ports match while names don't should return false",
7878
existingProbe: []network.Probe{
7979
{
8080
Name: to.StringPtr("probe1"),
@@ -129,7 +129,7 @@ func TestFindRule(t *testing.T) {
129129
expected: false,
130130
},
131131
{
132-
msg: "rule names unmatch should return false",
132+
msg: "rule names don't match should return false",
133133
existingRule: []network.LoadBalancingRule{
134134
{
135135
Name: to.StringPtr("httpProbe1"),
@@ -147,7 +147,7 @@ func TestFindRule(t *testing.T) {
147147
expected: false,
148148
},
149149
{
150-
msg: "rule names match while frontend ports unmatch should return false",
150+
msg: "rule names match while frontend ports don't should return false",
151151
existingRule: []network.LoadBalancingRule{
152152
{
153153
Name: to.StringPtr("httpProbe"),
@@ -165,7 +165,7 @@ func TestFindRule(t *testing.T) {
165165
expected: false,
166166
},
167167
{
168-
msg: "rule names match while backend ports unmatch should return false",
168+
msg: "rule names match while backend ports don't should return false",
169169
existingRule: []network.LoadBalancingRule{
170170
{
171171
Name: to.StringPtr("httpProbe"),
@@ -183,7 +183,7 @@ func TestFindRule(t *testing.T) {
183183
expected: false,
184184
},
185185
{
186-
msg: "rule names match while idletimeout unmatch should return false",
186+
msg: "rule names match while idletimeout don't should return false",
187187
existingRule: []network.LoadBalancingRule{
188188
{
189189
Name: to.StringPtr("httpRule"),
@@ -217,7 +217,7 @@ func TestFindRule(t *testing.T) {
217217
expected: true,
218218
},
219219
{
220-
msg: "rule names match while LoadDistribution unmatch should return false",
220+
msg: "rule names match while LoadDistribution don't should return false",
221221
existingRule: []network.LoadBalancingRule{
222222
{
223223
Name: to.StringPtr("probe1"),
@@ -722,7 +722,7 @@ func TestShouldReleaseExistingOwnedPublicIP(t *testing.T) {
722722
}
723723
}
724724

725-
func TestgetIPTagMap(t *testing.T) {
725+
func TestGetIPTagMap(t *testing.T) {
726726
tests := []struct {
727727
desc string
728728
input string
@@ -1170,7 +1170,7 @@ func TestGetServiceLoadBalancer(t *testing.T) {
11701170
expectedError: false,
11711171
},
11721172
{
1173-
desc: "getServiceLoadBalancer shall report error if there're loadbalancer mode annotations on a standard lb",
1173+
desc: "getServiceLoadBalancer shall report error if there are loadbalancer mode annotations on a standard lb",
11741174
service: getTestService("service1", v1.ProtocolTCP, nil, false, 80),
11751175
annotations: map[string]string{ServiceAnnotationLoadBalancerMode: "__auto__"},
11761176
sku: "standard",

0 commit comments

Comments
 (0)