Open jakefhyde opened 1 year ago
@richard-cox this topic is quite similar to our last discussion around extensions. I can reproduce this by enabling cloud.ca
node driver and creating a new RKE2 cloud.ca
cluster... It's supposed to "use" the resourceFields
coming from cloudcacredentialconfig
but I suspect that this won't work for RKE2 right?
also, this scenario happens because the KeyValue
is getting null from resourceFields
field on the schema.
There's a chance this has never worked. Node drivers that were implemented with RKE1 in mind appear enabled for RKE2 as well. Unless this worked in previous versions I don't think this is a 2.7.2 thing.
~An improvement would be to determine if we have a schema for the machine config associated with the provider (rke-machine-config.cattle.io.<provider name>config
) before showing the provider icon when creating an rke2 cluster. We should be careful though with how we get the provider name, it should be determined in the same when way we create the machine configs. @nwmac does that approach sound sensible? For instance enabling the open stack node driver meant the schema rke-machine-config.cattle.io.openstackconfigs
became available~
Edit: I'm talking junk, enabled node drivers have configs
@aalves08 You're talking about the cloudcacredentialConfig
field from the cloudcredential
resource? Are we not setting it correctly when created?
It should still be possible to add and use custom node drivers, also for RKE2.
@richard-cox FWIW Openstack is technically built-in. There are probably 3 separate categories of node drivers we need to support, embedded, custom (in-tree, i.e. everything available by default third party node driver), and then custom out-of-tree drivers that anyone can write. I don't think it's too much of a stretch on the backend side to generate the custom in-tree schemas (add here: https://github.com/rancher/rancher/blob/01454eb896ea8e46f95daf096afa56c6ad0e3e41/pkg/data/management/machinedriver_data.go#L38-L56) and do best effort for out-of-tree. @snasovich what do you think?
@jakefhyde I did some digging, and Vince wrote some docs on this before he left - https://rancher.github.io/dashboard/code-base-works/machine-drivers#driver-binary which help me understand a tad.
I'm not sure why prior to some actions (creating a cloudca cred), the form only shows apiKey
. Following that action the form shows no fields, as Alex pointed out, because the schemas/cloudcacredentialconfig resourceFields contains a null value.
Interestingly I'm assuming the BE should translate node driver annotations like publicCredentialFields, privateCredentialFields, etc into schema values. For cloudca their driver does NOT contain any similar node driver annotations
Ok, worked out some of the weirdness.
dynamicSchema
resource.create notifications for resources, specifically one with an id of cloudcacredentialconfig
. We do NOT get a resource.create for schema
though, so the UI doesn't know it existsRancher has no built-in support for this driver. We've taken a guess, but consult the driver's documentation for the fields required for authentication.
resourceFields
So...
resource.create
socket message for the cloudcacredentialconfig schema
shell/cloud-credential/generic.vue
data
method (resourceFields
if ( normanSchema ) {
--> if ( normanSchema ?.resourceFields
) {Related backend has moved to 2.7.x Q2 and likely will move to Q3.
@richard-cox & @jakefhyde shall I move this to 2.7.x for now if we're blocked on this? If this is needed, then we'd need to talk with Team 2.
Related backend has moved to 2.7.x Q2 and likely will move to Q3.
@richard-cox & @jakefhyde shall I move this to 2.7.x for now if we're blocked on this? If this is needed, then we'd need to talk with Team 2.
We should keep this one to address issue two from my comment above. The other issue from that comment is covered by the other ticket rancher/rancher side
@richard-cox @gaktive , is there capacity / enough time to ensure no regressions to fix "issue 2" for 2.7.2?
In summary
1) This issue only covers issue 2 from https://github.com/rancher/dashboard/issues/8523#issuecomment-1485581660 2) Issue 1 from https://github.com/rancher/dashboard/issues/8523#issuecomment-1485581660 means we have to refresh after enabling the cloud ca node provider 3) The credentials page should show the apiKeys field (as per the credentials page when creating an cloud ca credentials in embedded rke1 interface)
@snasovich it's a regression so we can get this into 2.7.2.
@gaktive , oh, I didn't realize it's a regression. Thank you for giving it priority then!
/backport v2.7.2
Added QA/None
since QA will test this in 2.7.2.
I'm adding the comment here for visibility. The fix unblocks users from creating credentials for cloud ca... however it falls back on a generic handler. There's a follow on issue for the maintainers of the node driver to either
QA TEST PLAN
Scenarios | Scenario | Test Case |
---|---|---|
1 | As a standard user, attempt to create a cloud credential for node driver Cloud.ca, delete that credential and add additional cloud credentials | |
2 | As a standard user, attempt to create a cloud credential for node driver Open Telekom Cloud, delete that credential and add additional cloud credentials |
Tested this against v2.7-head
https://github.com/rancher/rancher/commit/1712bf9f7116e25711fd76b99d7ce5672c2d4a23. Please see results below:
ENVIRONMENT DETAILS
v2.7-head
https://github.com/rancher/rancher/commit/1712bf9f7116e25711fd76b99d7ce5672c2d4a23TEST RESULT | Scenario | Test Case | Result |
---|---|---|---|
1 | As a standard user, attempt to create a cloud credential for node driver Cloud.ca, delete that credential and add additional cloud credentials | :x: | |
2 | As a standard user, attempt to create a cloud credential for node driver Open Telekom Cloud, delete that credential and add additional cloud credentials | :white_check_mark: |
VALIDATION STEPS
Scenario 1
Saved
, but it does not appear in the Cloud Credentials
list in Cluster Management:
Scenario 2
Cloud Credentials
list in Cluster Management:
NOTES I saw the exact behavior (as expected) in the backport issue, so I used the same GIFS here to showcase behavior seen. Reopening this issue due to the failures seen.
When the Cloud CA Node driver is enabled - browser is NOT refreshed (issue 1 from https://github.com/rancher/dashboard/issues/8523#issuecomment-1485581660)
cloudcacredentialconfig
schema resource.create
websocket message (see https://github.com/rancher/rancher/issues/40995)When the page is refreshed after enabling the node driver (issue 2 from https://github.com/rancher/dashboard/issues/8523#issuecomment-1485581660)
cloudcacredentialconfig
is returned in the http fetch for schemasresourceFields
(see https://github.com/rancher/dashboard/issues/8523#issuecomment-1490508448). so we fall back on fields from node driver (as per above)In terms of when a user creates a credentials when the form shows lots of values...
/v3/cloudcredentials
and get a 201 Created
responseid
for the credential, so it's not actually saved and returned for the user to selectGeneral OTC works fine because it's schema ("otccredentialconfig") has resourceFields
defined
Issue Wise....
/v3/cloudcredentials
succeeds, but does not return or persist resourceSummary
Note - Cloud CA credentials can still be created by creating a Node Template, either from the Cluster Manager Node Template list or going down the RKE1 cluster create route and adding it there.
Pushing to Q4 since Q3 timeline is tight and backend ticket not scheduled.
Internal reference: SURE-6517
Backend work remains unscheduled, need to check what's going on there.
Backend remains unscheduled and UI capacity for 2.10.0 needs to be considered.
Setup
7913e28
)Describe the bug
When enabling some custom node drivers, the Cloud Credential creation page doesn't not show the correct default fields, and has an uneditable
foo
key.To Reproduce
apiKey
) should show up the first time).Result
An unremovable
foo
key is presentExpected Result
Correct field
apiKey
shows in UIScreenshots
Additional context
I've noticed this on other cloud providers as well. As an aside, what populated these fields by default? Is it hard coded, or is it interpolated from available fields (from a list of
token
,apiKey
,password
, etc.), or is it coming from the backend somewhere and I've missed it?