-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Short Description
Add a more flexible system for building Redfish URLs and use it in PCS functions that talk to Redfish.
Definition of Done
- PCS functions that need Redfish URLs build them using a struct method. Setting struct fields allows overriding default URL segments.
- PCS can access power Redfish endpoints over HTTP or HTTPS.
- PCS supports insecure mode for Redfish HTTPS.
- (Optional) PCS allows appending a domain suffix to Redfish FQDNS.
Additional context
When retrieving power status and sending power transitions, PCS glues string components together inline to form URLs. This is not great, though my main issue was inability to change the protocol--getting a trusted cert into my BMC emulator was a bit annoying, and it was easier to switch to HTTP.
I also originally thought that the use of comp.HSMData.RfFQDN was an issue: PCS was attempting to talk to something like https://x1000c0s0b0n0/some-redfish-endpoint. x1000c0s0b0n0 doesn't resolve in my cluster, and we shouldn't expect that xnames always resolve the way they would have in CSM environments. This, however, was a limitation in ochami discover static: there is a Redfish FQDN value separate from the xname, but static discovery doesn't send it, and SMD defaults to the xname if it's absent.
pcs-url.diff.txt is a somewhat more robust URL build approach that allows overriding bits via envvars, because that was quicker than fixing the discover CLI. Ideally we'd use a struct with a BuildURL(path string) or BuildStatusURL() and BuildTransitionURL() methods.
Admittedly, there are apparently only two of these in all of PCS, but we should have something reusable, rather than have each function construct URLs from scratch.
I'm not sure if we can manage insecure. It's useful for testing, but the TRS cruft may make it annoying.
remote-console also uses the Redfish FQDN, but doesn't build full URLs. IDK if anything else would use it (FAS maybe, but we don't care about FAS).