feat(resmgr): cluster-blueprint family — REST client + host_config/host_role/host_config_assignment + blueprint DS - #29
Merged
Conversation
…sources
Add the first PCD-native (non-OpenStack) service to the provider.
- internal/clients: ResmgrV2Client() — a thin resmgr v2 REST client. resmgr has
no gophercloud constructor, so it resolves the "resmgr" catalog endpoint via
the ProviderClient's EndpointLocator and reuses the shared authenticated
ProviderClient for tokens (verified live against the CE lab).
- internal/services/resmgr:
- pcd_host_config: interface↔traffic-type mapping + physical-network labels
(CRUD via /hostconfigs).
- pcd_host_role: assign a role (e.g. pf9-ostackhost-neutron) to a host
(PUT/DELETE /hosts/{id}/roles/{name}; Read checks the host's roles list).
- pcd_host_config_assignment: attach a host config to a host
(PUT/DELETE /hosts/{id}/hostconfig/{id}; Read checks host.hostconfig_id).
- pcd_cluster_blueprint data source: read a blueprint by name (storage_backends
exposed as a sensitive JSON string since it carries driver credentials).
- templates: "cluster"/"host" → "Cluster Blueprint" doc subcategory.
Adversarial review found and fixed two host_config read-back defects (same class
as the blockstorage family): Create could orphan a created config and Update
could leave stale state when the post-write GET failed. Both now seed state from
the response already in hand (Create) / the applied plan (Update) and warn,
instead of hard-returning.
The pcd_cluster_blueprint RESOURCE (write path) is deferred to a focused
follow-up — full-object PUT, plaintext-credential storageBackends, and create
semantics that can't be safely verified without mutating the lab's blueprint.
See DECISIONS.md. Mutating resmgr acc tests are opt-in (PCD_ACC_RESMGR).
PF9-pushkar
force-pushed
the
feat/cluster-blueprint
branch
from
July 14, 2026 00:35
c2e2ebd to
3ba4c95
Compare
PF9-pushkar
added a commit
that referenced
this pull request
Jul 14, 2026
feat(resmgr): cluster-blueprint family — REST client + host_config/host_role/host_config_assignment + blueprint DS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the first PCD-native (non-OpenStack) service to the provider, closing the cluster-blueprint gap from the api-docs audit.
New client pattern
resmgrhas no gophercloud support, soclients.Config.ResmgrV2Client()is a hand-written REST client: it resolves theresmgrcatalog endpoint via the ProviderClient'sEndpointLocatorand reuses the shared authenticated ProviderClient for tokens. Verified live against the CE lab.Resources + data source
pcd_host_config/hostconfigs— traffic-type↔interface mapping + physical-network labelspcd_host_rolePUT/DELETE /hosts/{id}/roles/{name}— assign a role (e.g.pf9-ostackhost-neutron); Read checks the host'srolespcd_host_config_assignmentPUT/DELETE /hosts/{id}/hostconfig/{id}; Read checkshost.hostconfig_idpcd_cluster_blueprint(data source)storage_backends_jsonexposed as a sensitive JSON string (driver credentials)Schema modelled on the live lab responses (probed read-only), which are richer than the api-docs.
Adversarial review — 2 fixed
Both the same class as the block-storage family (fragile post-write read-back), confirmed against framework source:
Createcould orphan the created object on a read-back failure → now seeds state from the POST response and warns.Updatecould leave stale state on a read-back failure → now persists the applied plan and warns.Deliberately deferred: the
pcd_cluster_blueprintresourceIts write path is uniquely risky — full-object
PUT,storageBackendswith plaintext credentials, and create semantics I can't safely verify without mutating the lab's one working blueprint. Own follow-up (see DECISIONS.md).Testing
build / vet / gofmt / golangci-lint (0) / unit tests / terraform fmt / docs generate — all clean. Mutating acc tests are opt-in (
PCD_ACC_RESMGR); the blueprint DS test reads an existing blueprint (PCD_ACC_BLUEPRINT_NAME).