Skip to content

refactor(infrastructure): use path-only kustomize patches where self-identifying - #1929

Merged
botantler-1[bot] merged 3 commits into
mainfrom
claude/normalize-patch-target-style
Jun 9, 2026
Merged

botantler-1[bot] merged 3 commits into
mainfrom
claude/normalize-patch-target-style

Conversation

@devantler

Copy link
Copy Markdown
Contributor

What

Kustomize patch entries mixed two equivalent styles — an explicit target: selector next to path:, and path: alone — sometimes in the same file. Since every strategic-merge patch file already carries full identity (apiVersion/kind/name/namespace), the target: block merely restated it and was redundant.

Change

Drop the redundant target: selectors, keeping path: alone — the path-only style the hetzner overlays already use and that the coroot-patch comment documents. Converted 11 entries across 3 files:

  • providers/docker/infrastructure/controllers — 7 HelmRelease/KubeVirt patches
  • providers/hetzner/apps — 3 (ascoachingogvaner, headlamp, wedding-app)
  • providers/hetzner/infrastructure — 1 (gateway-patch)

Principled exception: whoami's patch is JSON6902 (a list of ops, no embedded identity) so it genuinely requires a target: — kept, now with a comment explaining why. The remaining mix is intentional and documented, not accidental.

Validation (behavior-preserving)

  • kubectl kustomize for all three affected provider paths is byte-identical to before.
  • ksail workload validate: local 0 failures; prod unchanged (only the pre-existing coroot catalog-schema failure).

🤖 Generated with Claude Code

…identifying

Patch entries mixed two equivalent styles — an explicit `target:` selector
alongside `path:`, and `path:` alone — sometimes within the same file. Every
strategic-merge patch file already carries full identity
(apiVersion/kind/name/namespace), so its `target:` block just restated that and
was redundant.

Drop the redundant `target:` selectors and keep `path:` alone, matching the
path-only style the hetzner overlays already use (and the convention the coroot
patch comment documents). The one genuine exception — whoami's JSON6902 patch,
which has no embedded identity — keeps its explicit target, now with a comment
explaining why.

Behavior-preserving: `kubectl kustomize` output for all three affected provider
paths (docker controllers, hetzner apps, hetzner infrastructure) is
byte-identical. `ksail workload validate` unchanged (local 0 failures; prod's
only failure is the pre-existing coroot catalog-schema one).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-project-automation github-project-automation Bot moved this to 🫴 Ready in 🌊 Project Board Jun 9, 2026
@devantler
devantler marked this pull request as ready for review June 9, 2026 17:43
@devantler
devantler enabled auto-merge June 9, 2026 17:43
@devantler
devantler added this pull request to the merge queue Jun 9, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Jun 9, 2026
# Conflicts:
#	k8s/providers/docker/infrastructure/controllers/kustomization.yaml
#	k8s/providers/hetzner/apps/kustomization.yaml
@devantler

Copy link
Copy Markdown
Contributor Author

The failing 🧪 System Test here is not caused by this PR — it's a pre-existing regression on main.

This PR's change is render-neutral (path-only patch style); its flagger HelmRelease is byte-identical to main (git diff origin/main -- .../flagger/helm-release.yaml is empty). The System Test fails at the flagger Helm install:

error while running post render on manifests: replace operation does not apply:
doc is missing path: /spec/strategy/type: missing value

Root cause: #1900 enabled flagger leaderElection, and the chart only renders strategy.type: Recreate when leaderElection is disabled — so the rendered Deployment no longer has a strategy block, and the post-renderer's op: replace /spec/strategy/type hits a missing path. This wedges infrastructure-controllers and fails the System Test on every k8s PR.

Fix in #1938 (changes the post-renderer to op: add /spec/strategy). Once that merges, re-running this PR's System Test should go green. No change needed here.

@botantler-1
botantler-1 Bot added this pull request to the merge queue Jun 9, 2026
Merged via the queue into main with commit a2986b3 Jun 9, 2026
10 checks passed
@botantler-1
botantler-1 Bot deleted the claude/normalize-patch-target-style branch June 9, 2026 21:55
@github-project-automation github-project-automation Bot moved this from 🫴 Ready to ✅ Done in 🌊 Project Board Jun 9, 2026
@botantler-1

botantler-1 Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.44.15 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@botantler-1 botantler-1 Bot added the released label Jun 9, 2026

This branch was previously deployed

1 inactive deployment
ci — 7a7fee14 Deployed Jun 9, 2026 by devantler via 🧪 System Test #2421
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant