kcc-direct-controller-logic-greenfield-implementer

Implements direct controller reconciliation logic and E2E fixtures for KCC Greenfield resources against real GCP.

1.1k|377|Updated Apr 8, 2019
One-click install
npx skills add https://github.com/GoogleCloudPlatform/k8s-config-connector --skill kcc-direct-controller-logic-greenfield-implementer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kcc-direct-controller-logic-greenfield-implementer
Source: https://github.com/GoogleCloudPlatform/k8s-config-connector/tree/main/.gemini/skills/kcc-direct-controller-logic-greenfield-implementer
Command: npx skills add https://github.com/GoogleCloudPlatform/k8s-config-connector --skill kcc-direct-controller-logic-greenfield-implementer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Implementing a new Config Connector direct controller requires coordinating adapter logic, mappers, fuzzers, E2E fixtures, and real-GCP golden file recording, which is error-prone without a structured workflow.

Core Features & Use Cases

  • Adapter Implementation: Guides Find, Create, Update, and Delete logic with patterns for proto desired state, structured diffs, LRO handling, and delete idempotency.
  • Fixture & Fuzzer Creation: Directs creation of minimal and maximal E2E fixtures plus fuzzer registration for round-trip testing.
  • Real GCP Verification: Enforces recording golden files with hack/record-gcp against live GCP, prohibiting mock fallbacks, and requires audit log proof in PRs.
  • Use Case: When adding a new Greenfield resource like a Vertex AI ExampleStore to Config Connector, use this Skill to implement the controller, record fixtures against real GCP, and produce a CI-compliant PR.

Quick Start

Implement the direct controller and record E2E fixtures for the KCC kind ExampleStore in package pkg/controller/direct/vertexai/examplestore using proto package google.cloud.aiplatform.v1.

Frequently Asked Questions about kcc-direct-controller-logic-greenfield-implementer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a KCC direct controller for a new GCP resource?

Implement the adapter's Find, Create, Update, and Delete methods in the resource's isolated package, converting the KRM spec to proto once in AdapterForObject. Then create minimal and maximal E2E fixtures and record them against real GCP with hack/record-gcp.

How to record E2E golden files for Config Connector resources?

Run RECORD_AUDIT_PROBE=1 ./hack/record-gcp with the fixture name pattern from the repository root for both minimal and maximal fixtures. Greenfield resources must record against real GCP and must not use mockgcp or compare-mock.

Should I use the GAPIC REST client or gRPC client in a KCC controller?

Prefer the GAPIC REST client (NewFooRESTClient) initialized with m.config.RESTClientOptions() because it aligns with HTTP golden traffic recording. Fall back to the gRPC GAPIC client, then raw protobuf gRPC, only if the REST variant fails during live testing.

Why does my KCC controller clear status fields after an update?

Many GCP APIs return empty or incomplete LRO responses, so mapping status directly from them wipes status fields. Always perform a GET after a Create or Update LRO completes and build status from the fully populated resource.

What tests must pass before submitting a KCC greenfield PR?

Run fuzz-roundtrippers, tests-e2e-fixtures-direct, CRD template tests, and apichecks field coverage tests, then run make ready-pr. The PR must document successful record-gcp execution and include GCP audit logs proving real API calls.