Skip to content

Commit 6c619f4

Browse files
Merge pull request #47 from JoelSpeed/remove-name
OCPBUGS-5546: Machine Actuator should not set metadata.name
2 parents 8b9d21c + 4b78135 commit 6c619f4

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

pkg/cloud/azure/actuators/machine_scope.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,6 @@ func updateFromSecret(coreClient controllerclient.Client, scope *MachineScope) e
333333
return fmt.Errorf("Azure region %v did not contain key %v",
334334
secretType.String(), AzureCredsRegionKey)
335335
}
336-
clusterName, ok := secret.Data[AzureResourcePrefix]
337-
if !ok {
338-
return fmt.Errorf("Azure resource prefix %v did not contain key %v",
339-
secretType.String(), AzureResourcePrefix)
340-
}
341336

342337
env, err := getEnvironment(scope)
343338
if err != nil {
@@ -373,7 +368,6 @@ func updateFromSecret(coreClient controllerclient.Client, scope *MachineScope) e
373368
scope.MachineConfig.Location = string(region)
374369
}
375370

376-
scope.MachineConfig.ObjectMeta.Name = string(clusterName)
377371
scope.Authorizer = authorizer
378372
scope.SubscriptionID = string(subscriptionID)
379373
scope.ResourceManagerEndpoint = env.ResourceManagerEndpoint

pkg/cloud/azure/actuators/machine_scope_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ func TestCredentialsSecretSuccess(t *testing.T) {
8080
AzureCredsTenantIDKey: []byte("dummyTenantID"),
8181
AzureCredsResourceGroupKey: []byte("dummyResourceGroup"),
8282
AzureCredsRegionKey: []byte("dummyRegion"),
83-
AzureResourcePrefix: []byte("dummyClusterName"),
8483
},
8584
}
8685

@@ -108,10 +107,6 @@ func TestCredentialsSecretSuccess(t *testing.T) {
108107
t.Errorf("Expected location to be dummyRegion but found %s", scope.Location())
109108
}
110109

111-
if scope.MachineConfig.Name != "dummyClusterName" {
112-
t.Errorf("Expected cluster name to be dummyClusterName but found %s", scope.MachineConfig.Name)
113-
}
114-
115110
if scope.MachineConfig.ResourceGroup != "dummyResourceGroup" {
116111
t.Errorf("Expected resourcegroup to be dummyResourceGroup but found %s", scope.MachineConfig.ResourceGroup)
117112
}
@@ -171,11 +166,6 @@ func TestCredentialsSecretFailures(t *testing.T) {
171166
}
172167

173168
credentialsSecret.Data["azure_region"] = []byte("dummyValue")
174-
if err := testCredentialFields(credentialsSecret); err == nil {
175-
t.Errorf("Expected New credentials secrets to fail")
176-
}
177-
178-
credentialsSecret.Data["azure_resource_prefix"] = []byte("dummyValue")
179169
if err := testCredentialFields(credentialsSecret); err != nil {
180170
t.Errorf("Expected New credentials secrets to succeed but found : %v", err)
181171
}

0 commit comments

Comments
 (0)