solve-migration-diff-issues

Diagnoses and fixes takeover diffs when migrating KCC controllers from Terraform/DCL to Direct.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

When migrating a Kubernetes Config Connector resource controller from the legacy Terraform/DCL approach to the Direct approach, the new controller often detects spurious differences during takeover and issues unwanted writes to GCP. This Skill provides a mandatory, ordered workflow to diagnose, explain, and eliminate those takeover diffs so the Direct controller adopts resources with a clean 0-write no-op reconciliation.

Core Features & Use Cases

  • Structured 4-Step Workflow: Enforces diagnosing on real GCP first (via ./hack/record-gcp), identifying root causes, fixing comparison logic in the Direct controller, and validating against real GCP.
  • Root Cause Patterns: Covers derived/computed fields, casing and alias mismatches, default value discrepancies, legacy diff suppression, and URL vs. relative path normalization.
  • Migration Journals: Includes per-resource journals (BigQueryDataset, ComputeNodeTemplate, ComputeTargetHTTPSProxy, NetworkServicesHTTPRoute) documenting real takeover diff symptoms and their resolutions.
  • Use Case: While migrating ComputeNodeTemplate to Direct, the takeover diff shows cpu_overcommit_type defaulting to NONE on GCP but nil in KRM; the Skill guides adding default normalization in the compare function and re-recording real GCP logs to verify a 0-write takeover.

Quick Start

Ask the agent to run the migration diff workflow for a specific fixture, starting with recording real GCP traffic for TestMigrationToDirect and analyzing the generated _migration_diffs.json file.

Frequently Asked Questions about solve-migration-diff-issues

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

FAQPage Schema
How do I fix takeover diffs when migrating a KCC controller to Direct?

Run the migration test against real GCP with ./hack/record-gcp, inspect the generated _migration_diffs.json for isNewObject:false blocks, identify the root cause, fix the Direct controller's comparison logic, then re-record on real GCP to confirm a 0-write takeover.

What causes takeover diffs in Config Connector direct migration?

Common causes include server-computed fields omitted from the KRM spec, casing or format differences like INT64 vs INTEGER, mismatched default values, legacy diff suppression logic, and fully-qualified GCP URLs versus relative resource paths.

Why must migration tests run against real GCP instead of MockGCP?

Real GCP runs exercise actual APIs, generate authentic audit logs, and produce a trustworthy _migration_diffs.json baseline. MockGCP can hide server-side defaults and behaviors, so fixes validated only against mocks may still cause writes on real GCP.

How do I handle optional fields that GCP populates but KRM omits?

Write a custom comparison function that returns no diff when the desired value is nil, regardless of the actual value returned by GCP. Name parameters actual and desired explicitly to avoid swap bugs, and normalize defaults before comparison.

What is the ratcheting exclusion list in KCC migration testing?

It is a switch statement in tests/e2e/ratcheting.go's ShouldTestRereconiliation function that skips re-reconciliation testing for listed resources. You must remove your target resource's case from it before running migration tests so re-reconciliation is verified.