Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.4] 🐛 fix provider namespace secret not included in clusterctl move #9749

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1695,15 +1695,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