Skip to content

Commit a1f8bf1

Browse files
HiranAdikariclaude
andcommitted
Fix stale local-only comment on VM create
resolveImage now routes through the cluster-access seam, so VM create's storageClass resolution is no longer local-only. Update the localOnlyErr doc + error message and the remote-client field comment to say the remaining local-only part is the full VM create orchestration (the VM CRUD lifecycle isn't routed yet), per review. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RC3BDHCFmJBdxvGVW69FAr
1 parent 0251152 commit a1f8bf1

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

dc-api/internal/providers/harvester/client.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,27 @@ type Client struct {
116116
// - GetVM's VMI IP enrichment read DEGRADES GRACEFULLY: it is SKIPPED (the
117117
// `c.dynamic == nil` guard returns the agent-supplied VM status WITHOUT IP
118118
// enrichment — no error), so a remote VM's status is still reported.
119-
// - the genuinely local-only ops — the cloud-provider SA bootstrap and VM
120-
// create's local storageClass resolution — have no direct path and return a
119+
// - the genuinely local-only ops — the cloud-provider SA bootstrap and the
120+
// full VM create orchestration — have no direct path and return a
121121
// clear local-only error (localOnlyErr) naming the zone instead of panicking
122122
// on a nil dynamic client.
123123
// Empty for the LOCAL client → today's behaviour.
124124
remoteRegion, remoteZone string
125125
}
126126

127127
// localOnlyErr is returned by a REMOTE client's direct-only methods: VM create
128-
// (which resolves the image storageClass — see CreateVM's note) and the
128+
// (the full create orchestration is not yet routed — see CreateVM's note) and the
129129
// cloud-provider SA bootstrap. These touch c.dynamic, which a remote client does
130130
// not have. Failing here — BEFORE a PENDING row or a provisioner call — is the
131131
// documented local-only constraint for the remote-zone build. NOTE: image
132132
// resolution/import (resolveImage, CreateImage) and the collection reads are NO
133133
// LONGER local-only — they route through the cluster-access seam (c.access), so a
134-
// remote client serves them via the agent; only VM create's storageClass lookup
135-
// and the SA bootstrap remain behind this explicit error.
134+
// remote client serves them via the agent. resolveImage's storageClass lookup
135+
// routes too; only the full VM create orchestration and the SA bootstrap remain
136+
// behind this explicit error.
136137
func (c *Client) localOnlyErr(op string) error {
137138
return fmt.Errorf(
138-
"%s is not supported for remote zone %s/%s yet: dc-api holds no direct Harvester credentials there (VM create's storageClass resolution and the cloud-provider SA bootstrap are local-only for now)",
139+
"%s is not supported for remote zone %s/%s yet: dc-api holds no direct Harvester credentials there (the full VM create orchestration and the cloud-provider SA bootstrap are local-only for now)",
139140
op, c.remoteRegion, c.remoteZone)
140141
}
141142

0 commit comments

Comments
 (0)