Skip to content

peerpod-ctrl: register gcp cloud provider#3076

Open
PeteE wants to merge 1 commit into
confidential-containers:mainfrom
opaque-systems:peerpod-ctrl-register-gcp-provider
Open

peerpod-ctrl: register gcp cloud provider#3076
PeteE wants to merge 1 commit into
confidential-containers:mainfrom
opaque-systems:peerpod-ctrl-register-gcp-provider

Conversation

@PeteE
Copy link
Copy Markdown

@PeteE PeteE commented May 19, 2026

Summary

  • Adds src/peerpod-ctrl/controllers/gcp.go, a //go:build gcp blank import of cloud-providers/gcp, mirroring the existing aws.go / azure.go / libvirt.go / ibmcloud.go / alibabacloud.go / byom.go registration files in the same package.
  • Without this, building peerpod-ctrl with -tags gcp compiles successfully but the GCP cloud-provider's init() is never linked in, so cloud.GetProvider("gcp") returns nothing and peerpod-ctrl cannot delete peer-pod VMs on GCP.
  • go.mod / go.sum changes are produced by go mod tidy after adding the import — every new entry carries // indirect because peerpod-ctrl only reaches the GCP SDK transitively through the cloud-providers/gcp package.

Motivation

Observed in a live GKE cluster running peerpod-ctrl built with -tags gcp. When a peer-pod is torn down, the reconciler logs:

INFO  deleting instance  {"InstanceID":"podvm-nginx-77b895b97f-xm8j5-b7bfc5f6","CloudProvider":"gcp"}
2026/05/19 16:18:26 [adaptor/cloud] Cloud provider external plugin loading is disabled, skipping plugin loading
ERROR Reconciler error  {"error":"gcp cloud provider not supported"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler
    /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.23.1/pkg/internal/controller/controller.go:495

"gcp cloud provider not supported" is the error returned when the provider registry has no gcp entry. With this blank import in place under the gcp build tag, the registry is populated and the reconciler succeeds.

Test plan

  • go build -tags gcp ./... in src/peerpod-ctrl/ succeeds
  • go mod tidy produces no further changes after the import is added
  • Deploy peerpod-ctrl built with -tags gcp on GKE, delete a peer-pod, confirm the reconciler no longer returns gcp cloud provider not supported

🤖 Generated with Claude Code

@PeteE PeteE requested a review from a team as a code owner May 19, 2026 16:57
Signed-off-by: Pete Erickson <pete@opaque.co>
@PeteE PeteE force-pushed the peerpod-ctrl-register-gcp-provider branch from 3cafa4d to 270c06b Compare May 19, 2026 16:58
PeteE added a commit to opaque-systems/cloud-api-adaptor that referenced this pull request May 19, 2026
Copy link
Copy Markdown
Member

@bpradipt bpradipt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
Thanks @PeteE

Copy link
Copy Markdown
Contributor

@snir911 snir911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM, @PeteEC can you confirm this was tested? (run pod -> delete caa -> delete pod -> pod is dangling -> peerpod-ctrl clean the dangling pod)

@PeteE
Copy link
Copy Markdown
Author

PeteE commented May 20, 2026

Thanks! LGTM, @PeteEC can you confirm this was tested? (run pod -> delete caa -> delete pod -> pod is dangling -> peerpod-ctrl clean the dangling pod)

Yes I will verify today and post results!

@bpradipt
Copy link
Copy Markdown
Member

Thanks! LGTM, @PeteEC can you confirm this was tested? (run pod -> delete caa -> delete pod -> pod is dangling -> peerpod-ctrl clean the dangling pod)

Yes I will verify today and post results!

@PeteE possible to post the result today and rebase it?

Copy link
Copy Markdown
Member

@beraldoleal beraldoleal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks. Needs a rebase tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants