Skip to content

Commit ac6e65d

Browse files
fix provider namespace secret not included in clusterctl move
1 parent 3fac15b commit ac6e65d

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

cmd/clusterctl/client/cluster/objectgraph.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ func (o *objectGraph) Discovery(namespace string) error {
432432
}
433433

434434
// if we are discovering Secrets, also secrets from the providers namespace should be included.
435-
if discoveryType.typeMeta.GetObjectKind().GroupVersionKind().GroupKind() == corev1.SchemeGroupVersion.WithKind("SecretList").GroupKind() {
435+
if discoveryType.typeMeta.GetObjectKind().GroupVersionKind().GroupKind() == corev1.SchemeGroupVersion.WithKind("Secret").GroupKind() {
436436
providers, err := o.providerInventory.List()
437437
if err != nil {
438438
return err

cmd/clusterctl/client/cluster/objectgraph_test.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,15 +1695,7 @@ func getFakeProxyWithCRDs() *test.FakeProxy {
16951695
}
16961696

16971697
func getFakeDiscoveryTypes(graph *objectGraph) error {
1698-
if err := graph.getDiscoveryTypes(); err != nil {
1699-
return err
1700-
}
1701-
1702-
// Given that the Fake client behaves in a different way than real client, for this test we are required to add the List suffix to all the types.
1703-
for _, discoveryType := range graph.types {
1704-
discoveryType.typeMeta.Kind = fmt.Sprintf("%sList", discoveryType.typeMeta.Kind)
1705-
}
1706-
return nil
1698+
return graph.getDiscoveryTypes()
17071699
}
17081700

17091701
func TestObjectGraph_Discovery(t *testing.T) {

0 commit comments

Comments
 (0)