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

Mark provider name optional for Custom providers, and remove for predefined #64

Open
Danil-Grigorev opened this issue Jun 6, 2024 · 7 comments
Assignees
Labels
area/ui kind/enhancement New feature or request

Comments

@Danil-Grigorev
Copy link

Danil-Grigorev commented Jun 6, 2024

The CAPIProvider since v0.8.0 no longer requires spec.name to be specified at all times. In case when it is not set, it uses metadata.name, so this field can be marked as optional.

It makes sense to specify spec.name only if the kind of provider is unknown. For existing set of providers like Docker, AWS, etc., the default one for the applied resource coming from UI code is enough.

Why

This will remove ambiguity. Users may supply a name for docker provider like aws and install aws provider under docker label.

image
@Danil-Grigorev Danil-Grigorev changed the title Mark provider name optional Mark provider name optional for Custom providers, and remove for predefined Jun 6, 2024
@eva-vashkevich eva-vashkevich self-assigned this Jul 8, 2024
@eva-vashkevich
Copy link
Member

Hi @Danil-Grigorev, the "Name" field from your screenshot sets metadata.name field. We only allow user to provide spec.name when creating Custom provider ('Provider' field). Are you suggesting we should not be asking the user to provide metadata.name and supply the name ourselves instead?

@Danil-Grigorev
Copy link
Author

I’m not aware of the internals that much to tell that metadata.name is set or the spec.name is. I’m suggesting that for known provider types, which are known in the UI tiles it should not be possible to supply a name at all. The UI always knows it in advance. Example: docker is always docker, aws is always aws. If you call aws as my-aws, it is still the same aws provider, and on top of that there shall not allow creation of duplicate providers in the cluster (read: creating duplicate CAPIProvider with the same spec.type)

@eva-vashkevich
Copy link
Member

Hi @kwwii, what do you think?

@kwwii
Copy link

kwwii commented Jul 18, 2024

  1. If you can only create one of each type of infrastructure provider, how does one enter different credentials for different accounts?
    a) Assuming that there CAN be multiple, how would a user select the correct infrastructure provider later in the UI?

@kwwii
Copy link

kwwii commented Jul 18, 2024

Currently, the backend allows the creation of multiple providers of a given type. Is this expected to change?

@kwwii
Copy link

kwwii commented Jul 18, 2024

Given that we currently allow for more than one provider of a given type, we cannot remove the name field as we need it to differentiate between providers of the same type in the provider list.

@Danil-Grigorev
Copy link
Author

We’ve discussed the issue on the call. The conclusion is that we can’t have multiple providers of the same type due to cluster-api-operator limitation (thanks @alexander-demicev for pointing this out). The reason being that this may lead to clashing cluster-scoped objects, like CRDs whenever there more then one provider of this type is installed. More context on this: kubernetes-sigs/cluster-api#9875 (comment) Since the CAPI operator uses clusterctl libraries, this limitation extends on the project too.

@kwwii pointed out that this limitation may have larger impact on UI and credentials handling mechanism and it requires additional changes.

@kkaempf kkaempf added the kind/enhancement New feature or request label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui kind/enhancement New feature or request
Development

No branches or pull requests

5 participants