Skip to content

Commit b9bb053

Browse files
authored
Merge pull request #4831 from nojnhuh/identity-resourceid
deprecate AzureClusterIdentity spec.resourceID
2 parents 31dd10c + 1b5ac25 commit b9bb053

File tree

8 files changed

+9
-11
lines changed

8 files changed

+9
-11
lines changed

api/v1beta1/azureclusteridentity_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ type AzureClusterIdentitySpec struct {
4848
Type IdentityType `json:"type"`
4949
// ResourceID is the Azure resource ID for the User Assigned MSI resource.
5050
// Only applicable when type is UserAssignedMSI.
51+
//
52+
// Deprecated: This field no longer has any effect.
53+
//
5154
// +optional
5255
ResourceID string `json:"resourceID,omitempty"`
5356
// ClientID is the service principal client ID.

api/v1beta1/azureclusteridentity_validation.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ import (
2424

2525
func (c *AzureClusterIdentity) validateClusterIdentity() (admission.Warnings, error) {
2626
var allErrs field.ErrorList
27-
if c.Spec.Type == UserAssignedMSI && c.Spec.ResourceID == "" {
28-
allErrs = append(allErrs, field.Required(field.NewPath("spec", "resourceID"), c.Spec.ResourceID))
29-
} else if c.Spec.Type != UserAssignedMSI && c.Spec.ResourceID != "" {
27+
if c.Spec.Type != UserAssignedMSI && c.Spec.ResourceID != "" {
3028
allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "resourceID"), c.Spec.ResourceID))
3129
}
3230
if len(allErrs) == 0 {

api/v1beta1/azureclusteridentity_webhook_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func TestAzureClusterIdentity_ValidateCreate(t *testing.T) {
7676
TenantID: fakeTenantID,
7777
},
7878
},
79-
wantErr: true,
79+
wantErr: false,
8080
},
8181
}
8282

azure/scope/identity_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ func TestHasClientSecret(t *testing.T) {
143143
name: "user assigned identity",
144144
identity: &infrav1.AzureClusterIdentity{
145145
Spec: infrav1.AzureClusterIdentitySpec{
146-
Type: infrav1.UserAssignedMSI,
147-
ResourceID: "my-resource-id",
146+
Type: infrav1.UserAssignedMSI,
148147
},
149148
},
150149
want: false,

config/crd/bases/infrastructure.cluster.x-k8s.io_azureclusteridentities.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ spec:
144144
description: |-
145145
ResourceID is the Azure resource ID for the User Assigned MSI resource.
146146
Only applicable when type is UserAssignedMSI.
147+
148+
149+
Deprecated: This field no longer has any effect.
147150
type: string
148151
tenantID:
149152
description: TenantID is the service principal primary tenant id.

docs/book/src/topics/identities.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ spec:
155155
type: UserAssignedMSI
156156
tenantID: <azure-tenant-id>
157157
clientID: <client-id-of-user-assigned-identity>
158-
resourceID: <resource-id-of-user-assigned-identity>
159158
allowedNamespaces:
160159
list:
161160
- <cluster-namespace>

templates/test/ci/cluster-template-prow-private.yaml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/test/ci/prow-private/patches/user-assigned.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
value: UserAssignedMSI
44
- op: remove
55
path: /spec/clientSecret
6-
- op: add
7-
path: /spec/resourceID
8-
value: /subscriptions/${AZURE_SUBSCRIPTION_ID}/resourceGroups/${CI_RG:=capz-ci}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/${USER_IDENTITY:=cloud-provider-user-identity}
96
- op: replace
107
path: /spec/clientID
118
value: ${UAMI_CLIENT_ID}

0 commit comments

Comments
 (0)