Skip to content

Commit

Permalink
fix provider namespace secret not included in clusterctl move
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziopandini committed Nov 21, 2023
1 parent cf0e76d commit 23b49d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmd/clusterctl/client/cluster/objectgraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ func (o *objectGraph) Discovery(namespace string) error {
}

// if we are discovering Secrets, also secrets from the providers namespace should be included.
if discoveryType.typeMeta.GetObjectKind().GroupVersionKind().GroupKind() == corev1.SchemeGroupVersion.WithKind("SecretList").GroupKind() {
if discoveryType.typeMeta.GetObjectKind().GroupVersionKind().GroupKind() == corev1.SchemeGroupVersion.WithKind("Secret").GroupKind() {
providers, err := o.providerInventory.List()
if err != nil {
return err
Expand Down
10 changes: 1 addition & 9 deletions cmd/clusterctl/client/cluster/objectgraph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1772,15 +1772,7 @@ func getFakeProxyWithCRDs() *test.FakeProxy {
}

func getFakeDiscoveryTypes(graph *objectGraph) error {
if err := graph.getDiscoveryTypes(); err != nil {
return err
}

// 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.
for _, discoveryType := range graph.types {
discoveryType.typeMeta.Kind = fmt.Sprintf("%sList", discoveryType.typeMeta.Kind)
}
return nil
return graph.getDiscoveryTypes()
}

func TestObjectGraph_Discovery(t *testing.T) {
Expand Down

0 comments on commit 23b49d5

Please sign in to comment.