Create Direct Controller Skill

Configure DefaultController and SupportedControllers for a GVK in static_config.go.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Teams need a safe, low-risk way to introduce a direct controller for an existing Config Connector resource that already has a Terraform or DCL controller, without breaking reconciliation or creating confusing diffs.

Core Features & Use Cases

  • Controlled migration: Keep the existing Terraform/DCL controller as the default while adding the direct controller to the supported list.
  • Side-by-side verification: Enable golden/e2e testing so diffs can be computed and checked for the direct controller against the older controller.
  • Incremental rollout: Start with a focused set of resource kinds and expand coverage once behavior matches expectations.

Quick Start

Ask the skill to outline the exact code changes required in static_config.go and unified_test.go to add a direct controller and run side-by-side golden tests for your target GVKs.

Frequently Asked Questions about Create Direct Controller Skill

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

FAQPage Schema
How do I migrate a Config Connector resource from a Terraform to a direct controller safely?

Migrating to a direct controller safely involves keeping the existing Terraform or DCL controller as the default while adding the direct controller to the supported list, enabling side-by-side verification without breaking reconciliation.

What is a direct controller in Config Connector resource development?

A direct controller is a reconciliation mechanism added to a Config Connector resource's supported list. It runs alongside existing Terraform or DCL controllers to verify behavior through computed diffs before becoming the default.

How do I run golden e2e tests for a direct controller migration?

To run golden e2e tests for a direct controller migration, modify tests/e2e/unified_test.go to force direct-side execution for your selected fixture kinds. This computes diffs to verify behavior against the older controller.

Does adding a direct controller require updating static_config.go?

Yes, adding a direct controller requires updating pkg/controller/resourceconfig/static_config.go to include k8s.ReconcilerTypeDirect. This defines the DefaultController and SupportedControllers for your target GVK.

Can I verify direct controller behavior without removing the existing Terraform controller?

Yes, you can verify direct controller behavior without removing the Terraform controller. Keep Terraform as the default and enable golden e2e testing to compute and check diffs between both controllers side-by-side.

What are the limitations of incremental direct controller rollout?

The limitation of incremental direct controller rollout is that you must start with a focused set of resource kinds and expand coverage only once behavior matches expectations. It requires strict side-by-side verification to avoid confusing diffs.