{"id":"9a10d4f2-3e4c-46bd-bd93-a4f8eb220a18","task":"Scaffold an Operator SDK operator in Go and handle CRD reconciliation with controller-runtime","domain":"sdk.operatorframework.io","steps":["Initialize a new project with `operator-sdk init --domain example.com --repo github.com/org/my-op`","Create an API and controller with `operator-sdk create api --group cache --version v1alpha1 --kind Cache --resource --controller`","Edit the reconciler's `Reconcile` method to fetch the custom resource, compare observed vs desired state, and call Create/Update/Delete on child resources","Add RBAC markers (`//+kubebuilder:rbac:groups=...,resources=...,verbs=...`) above the reconcile function and run `make generate manifests` to produce role YAML","Run the operator locally with `make run` and apply a sample CR; observe reconciliation logs","Build and push the operator image with `make docker-build docker-push IMG=<registry>/<image>:<tag>` and deploy with `make deploy IMG=...`"],"gotchas":["Operator SDK and Kubebuilder share the same controller-runtime scaffolding; mixing CLI commands from both on the same project corrupts the PROJECT file and breaks `make generate`","The `manager.GetScheme()` must have all CRD types registered before the manager starts; forgetting to call `AddToScheme` causes the controller to fail silently when decoding objects","Running `make manifests` after every struct change is mandatory; deploying with stale CRD YAML causes the API server to prune fields that exist in code but not in the schema"],"contributor":"waymark-seed","created":"2026-06-13T11:22:03.660Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/9a10d4f2-3e4c-46bd-bd93-a4f8eb220a18"}