with one click
kcc-direct-controller-logic-implementer
// Implement the core reconciliation logic (Adapter) and E2E fixtures for a direct KCC resource. Use this after Step 1 is complete.
// Implement the core reconciliation logic (Adapter) and E2E fixtures for a direct KCC resource. Use this after Step 1 is complete.
Moves a mockgcp service from using locally generated grpc-gateway proto bindings to using reflection with the official Google Cloud Go client library (httptogrpc). Use this when tasked with stopping grpc-gateway generation for a GCP service in mockgcp.
Creates or updates the _identity.go and _reference.go files for a Config Connector resource, ensuring they follow the canonical gcpurls.Template pattern. Use this when you need to make sure the identity and reference is up to date for a KCC resource or when implementing IdentityV2 and refs.Ref for a resource.
Implement the controller, mappers, and fuzzer for a direct KCC resource, ensuring package isolation and CI compliance. Use this when implementing the main reconciliation logic for a "direct" resource.
Guides the implementation of KRM types and CRD scaffolding for new "direct" resources.
Provides instructions and a tool for analyzing Custom Resource Definition (CRD) changes, including checking for KRM API structural equivalence and backward compatibility.
Checks apis/ subdirectories for missing generate.sh and helps create PRs to add them, following the pattern in
| name | kcc-direct-controller-logic-implementer |
| description | Implement the core reconciliation logic (Adapter) and E2E fixtures for a direct KCC resource. Use this after Step 1 is complete. |
This skill guides the implementation of the Adapter interface and the creation of "Minimal" and "Maximal" E2E fixtures to verify the resource against real GCP.
resource_kind: The KCC Kind.service_name: The GCP service name (short, e.g., apigee).api_version: The KCC API version.Implement Adapter Logic:
Update pkg/controller/direct/<service>/<resource_lower>_controller.go.
Find, Create, Update, and Delete.Find).Create Minimal Fixture:
Create directory pkg/test/resourcefixture/testdata/basic/<service_name>/<api_version>/<resource_lower>/<resource_lower>-minimal/.
create.yaml: Use the bare minimum Required fields.${uniqueId} for resource names.Create Maximal Fixture:
Create directory pkg/test/resourcefixture/testdata/basic/<service_name>/<api_version>/<resource_lower>/<resource_lower>-maximal/.
create.yaml: Include every supported field in the Spec.update.yaml: Update all mutable fields.dependencies.yaml if the resource requires other KCC resources to exist first.Record Golden Files (Real GCP): Run the tests against real GCP to record the traffic and object state. Ensure you use a sufficient timeout (e.g., 30-60 minutes) as GCP resource creation can be slow:
# Run from the repository root
RUN_E2E=1 \
E2E_GCP_TARGET=real \
E2E_KUBE_TARGET=envtest \
GOLDEN_REQUEST_CHECKS=1 \
GOLDEN_OBJECT_CHECKS=1 \
WRITE_GOLDEN_OUTPUT=1 \
go test -v ./tests/e2e \
-timeout 60m \
-run TestAllInSeries/fixtures/<resource_lower>-minimal
Repeat for the -maximal fixture. Commit the resulting _http.log and _generated_object_*.golden.yaml files.
Verify Field Coverage: Run the API check tests:
WRITE_GOLDEN_OUTPUT=1 go test -v ./tests/apichecks/... -run TestCRDFieldPresenceInTestsForAlphaVerify and Record against MockGCP:
If a mock implementation for the service exists in mockgcp/, you should prioritize running and recording against the mock. This allows for fast, hermetic iteration.
Check for Mock: Verify if mockgcp/mock<service_name> exists.
Run and Record Mock:
RUN_E2E=1 \
E2E_GCP_TARGET=mock \
E2E_KUBE_TARGET=envtest \
GOLDEN_REQUEST_CHECKS=1 \
GOLDEN_OBJECT_CHECKS=1 \
WRITE_GOLDEN_OUTPUT=1 \
go test -v ./tests/e2e \
-timeout 10m \
-run TestAllInSeries/fixtures/<resource_lower>-minimal
Note: Automated agents should ONLY run against MockGCP if it exists to avoid requiring real GCP credentials.
Append any reconciliation hurdles, GCP SDK quirks, or MockGCP alignment issues to .gemini/journals/<service>.md using the format described in the kcc-agentic-journaler skill.