Open Danil-Grigorev opened 1 month ago
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?
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
)
Hi @kwwii, what do you think?
The
CAPIProvider
since v0.8.0 no longer requiresspec.name
to be specified at all times. In case when it is not set, it usesmetadata.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 installaws
provider underdocker
label.