Skip to content

Commit 92c4692

Browse files
committed
Improve test coverage of managed identities
Signed-off-by: Gavin Shaw <gshaw+github@pivotal.io>
1 parent 79e4449 commit 92c4692

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

internal/resources/akscluster/helpers_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ func aTestCluster(w ...clusterWither) *models.VmwareTanzuManageV1alpha1AksCluste
159159
AutoUpgradeConfig: &models.VmwareTanzuManageV1alpha1AksclusterAutoUpgradeConfig{
160160
Channel: models.VmwareTanzuManageV1alpha1AksclusterChannelSTABLE.Pointer(),
161161
},
162+
IdentityConfig: &models.VmwareTanzuManageV1alpha1AksclusterManagedIdentityConfig{
163+
Type: models.VmwareTanzuManageV1alpha1AksclusterManagedIdentityTypeUSERASSIGNED.Pointer(),
164+
UserAssignedIdentityType: &models.VmwareTanzuManageV1alpha1AksclusterUserAssignedIdentityTypeConfig{
165+
ManagedResourceID: "resource-id-for-a-user-assigned-managed-identity",
166+
},
167+
},
162168
},
163169
ProxyName: "my-proxy",
164170
AgentName: "my-agent-name",
@@ -372,7 +378,12 @@ func aTestClusterDataMap(w ...mapWither) map[string]any {
372378
"auto_upgrade_config": []any{map[string]any{
373379
"upgrade_channel": "STABLE",
374380
}},
375-
"identity_config": []any{},
381+
"identity_config": []any{map[string]any{
382+
"type": "IDENTITY_TYPE_USER_ASSIGNED",
383+
"user_assigned": []any{map[string]any{
384+
"resource_id": "resource-id-for-a-user-assigned-managed-identity",
385+
}},
386+
}},
376387
}},
377388
"nodepool": []any{
378389
aTestNodepoolDataMap(),

0 commit comments

Comments
 (0)