Skip to content

Commit

Permalink
Merge pull request #9746 from fabriziopandini/cherry-pick-9694-to-rel…
Browse files Browse the repository at this point in the history
…ease-1.5

[release-1.5] 🐛 fix provider namespace secret not included in clusterctl move
  • Loading branch information
k8s-ci-robot committed Nov 22, 2023
2 parents 47a00d7 + 23b49d5 commit fd9f333
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 fd9f333

Please sign in to comment.