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

🐛: fix unknown provider errors when using fetchConfigs #730

Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
nit: avoid shadowing genericProviderList type
  • Loading branch information
w21froster committed Mar 3, 2025
commit de29d47af665b9afd9da3bdbec7cb87a7f4433b0
10 changes: 5 additions & 5 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,22 @@ func GetCustomProviders(ctx context.Context, cl ctrlclient.Client, currProvider
currProviderType := currProvider.GetType()

for _, providerList := range operatorv1.ProviderLists {
genericProviderList, ok := providerList.(genericProviderList)
genProviderList, ok := providerList.(genericProviderList)
if !ok {
return nil, fmt.Errorf("cannot cast providers list to genericProviderList")
}

if err := cl.List(ctx, genericProviderList); err != nil {
if err := cl.List(ctx, genProviderList); err != nil {
return nil, fmt.Errorf("cannot get a list of providers from the server: %w", err)
}

genericProviderListItems := genericProviderList.GetItems()
for i, provider := range genericProviderListItems {
genProviderListItems := genProviderList.GetItems()
for i, provider := range genProviderListItems {
if provider.GetName() == currProviderName && provider.GetType() == currProviderType || provider.GetSpec().FetchConfig == nil {
continue
}

customProviders = append(customProviders, genericProviderListItems[i])
customProviders = append(customProviders, genProviderListItems[i])
}
}

Expand Down