Skip to content

Commit 6f4dc78

Browse files
committed
Fix the resource definition and API endpoint in the test as per the schema
Signed-off-by: Ramya Bangera <bangerar@vmware.com>
1 parent 87d9d2d commit 6f4dc78

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

internal/resources/customiamrole/tests/custom_iam_role_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func verifyTanzuKubernetesClusterResource(
9696
Name: customRoleName,
9797
}
9898

99-
resp, err := context.TMCConnection.CustomIAMRoleResourceService.CustomIARoleResourceServiceGet(fn)
99+
resp, err := context.TMCConnection.CustomIAMRoleResourceService.CustomIAMRoleResourceServiceGet(fn)
100100

101101
if err != nil {
102102
return errors.Errorf("Custom IAM Role resource not found, resource: %s | err: %s", resourceName, err)

internal/resources/customiamrole/tests/resource_tf_configs.go

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,21 @@ func (builder *ResourceTFConfigBuilder) GetCustomFullIAMRoleConfig() string {
5656
}
5757
}
5858
59-
resources = ["ORGANIZATION", "CLUSTER_GROUP", "CLUSTER"]
59+
allowed_scopes = ["ORGANIZATION", "CLUSTER_GROUP", "CLUSTER"]
6060
tanzu_permissions = ["account.credential.iam.get"]
6161
62-
rule {
63-
resources = ["deployments"]
64-
verbs = ["get", "list"]
65-
api_groups = ["*"]
66-
}
67-
68-
rule {
69-
verbs = ["get", "list"]
70-
api_groups = ["*"]
71-
url_paths = ["/healthz"]
62+
kubernetes_permissions {
63+
rule {
64+
resources = ["deployments"]
65+
verbs = ["get", "list"]
66+
api_groups = ["*"]
67+
}
68+
69+
rule {
70+
verbs = ["get", "list"]
71+
api_groups = ["*"]
72+
url_paths = ["/healthz"]
73+
}
7274
}
7375
}
7476
}
@@ -85,12 +87,14 @@ func (builder *ResourceTFConfigBuilder) GetCustomSlimIAMRoleConfig() string {
8587
name = "%s"
8688
8789
spec {
88-
resources = ["ORGANIZATION", "CLUSTER_GROUP", "CLUSTER"]
90+
allowed_scopes = ["ORGANIZATION", "CLUSTER_GROUP", "CLUSTER"]
8991
90-
rule {
91-
resources = ["deployments"]
92-
verbs = ["get", "list"]
93-
api_groups = ["*"]
92+
kubernetes_permissions {
93+
rule {
94+
resources = ["deployments"]
95+
verbs = ["get", "list"]
96+
api_groups = ["*"]
97+
}
9498
}
9599
}
96100
}

0 commit comments

Comments
 (0)