@@ -1092,7 +1092,7 @@ func Test_objectGraph_setSoftOwnership(t *testing.T) {
1092
1092
fields : fields {
1093
1093
objs : test .NewFakeCluster ("ns1" , "foo" ).Objs (),
1094
1094
},
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
1096
1096
"/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
1097
1097
"cluster.x-k8s.io/v1alpha3, Kind=Cluster, ns1/foo" ,
1098
1098
},
@@ -1114,22 +1114,22 @@ func Test_objectGraph_setSoftOwnership(t *testing.T) {
1114
1114
t .Fatalf ("got = %d secrets, want %d" , len (gotSecrets ), len (tt .wantSecrets ))
1115
1115
}
1116
1116
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 )]
1119
1119
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 )
1121
1121
}
1122
1122
1123
1123
gotObjects := []string {}
1124
- for softOwners := range cluster .softOwners {
1124
+ for softOwners := range secret .softOwners {
1125
1125
gotObjects = append (gotObjects , string (softOwners .identity .UID ))
1126
1126
}
1127
1127
1128
1128
sort .Strings (wantObjects )
1129
1129
sort .Strings (gotObjects )
1130
1130
1131
1131
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 )
1133
1133
}
1134
1134
}
1135
1135
})
@@ -1271,7 +1271,7 @@ func Test_objectGraph_setClusterTenants(t *testing.T) {
1271
1271
t .Fatal (err )
1272
1272
}
1273
1273
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
1275
1275
gb .setSoftOwnership ()
1276
1276
1277
1277
// finally test SetClusterTenants
0 commit comments