Skip to content

Commit 3be299c

Browse files
address comments
1 parent 22be9f9 commit 3be299c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cmd/clusterctl/pkg/client/cluster/objectgraph_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ func Test_objectGraph_setSoftOwnership(t *testing.T) {
10921092
fields: fields{
10931093
objs: test.NewFakeCluster("ns1", "foo").Objs(),
10941094
},
1095-
wantSecrets: map[string][]string{ // wantSecrets is a map[Cluster.UID] --> list of UIDs
1095+
wantSecrets: map[string][]string{ // wantSecrets is a map[node UID] --> list of soft owner UIDs
10961096
"/v1, Kind=Secret, ns1/foo-ca": { // the ca secret has no explicit OwnerRef to the cluster, so it should be identified as a soft ownership
10971097
"cluster.x-k8s.io/v1alpha3, Kind=Cluster, ns1/foo",
10981098
},
@@ -1114,22 +1114,22 @@ func Test_objectGraph_setSoftOwnership(t *testing.T) {
11141114
t.Fatalf("got = %d secrets, want %d", len(gotSecrets), len(tt.wantSecrets))
11151115
}
11161116

1117-
for _, cluster := range gotSecrets {
1118-
wantObjects, ok := tt.wantSecrets[string(cluster.identity.UID)]
1117+
for _, secret := range gotSecrets {
1118+
wantObjects, ok := tt.wantSecrets[string(secret.identity.UID)]
11191119
if !ok {
1120-
t.Fatalf("got = %s, not included in the expected secrect list", cluster.identity.UID)
1120+
t.Fatalf("got = %s, not included in the expected secrect list", secret.identity.UID)
11211121
}
11221122

11231123
gotObjects := []string{}
1124-
for softOwners := range cluster.softOwners {
1124+
for softOwners := range secret.softOwners {
11251125
gotObjects = append(gotObjects, string(softOwners.identity.UID))
11261126
}
11271127

11281128
sort.Strings(wantObjects)
11291129
sort.Strings(gotObjects)
11301130

11311131
if !reflect.DeepEqual(gotObjects, wantObjects) {
1132-
t.Fatalf("secret %s, got = %s, expected = %s", cluster.identity.UID, gotObjects, wantObjects)
1132+
t.Fatalf("secret %s, got = %s, expected = %s", secret.identity.UID, gotObjects, wantObjects)
11331133
}
11341134
}
11351135
})
@@ -1271,7 +1271,7 @@ func Test_objectGraph_setClusterTenants(t *testing.T) {
12711271
t.Fatal(err)
12721272
}
12731273

1274-
// we want ti check that soft dependent nodes are considered part of the cluster, so we make sure to call SetSoftDependants before SetClusterTenants
1274+
// we want to check that soft dependent nodes are considered part of the cluster, so we make sure to call SetSoftDependants before SetClusterTenants
12751275
gb.setSoftOwnership()
12761276

12771277
// finally test SetClusterTenants

0 commit comments

Comments
 (0)