Skip to content

[P0] Replace trigger-based Deployment drift checks with declarative reconciliation #2

Description

@jacaudi

Context

The Deployment is not reconciled declaratively. It is only rebuilt when one of four specific checks fires in internal/controller/wireguard_controller.go:

  • agent image drift (:824)
  • userspace flag toggle (:844)
  • tunnel sidecar toggle (:861)
  • nodeSelector / tolerations change (:871)

Anything else can be edited on the Wireguard resource and simply never take effect on an already-created Deployment.

Why it matters

Every new spec field on the roadmap (init containers, extra containers, volumes, gluetun) would otherwise need its own bespoke drift check. Miss one and the field silently does nothing after first create — the worst kind of bug to diagnose.

Scope

Compute the desired Deployment once, semantically diff it against the actual, and update when they differ. Take care not to hot-loop on server-defaulted fields (creationTimestamp, defaulted probe fields, terminationMessagePath, etc.).

Acceptance criteria

  • Desired Deployment computed once and diffed against actual
  • Changing any pod-affecting spec field triggers an update
  • No update churn when nothing has changed — verified by (a) resourceVersion stable across several reconciles and (b) at most one apply per owned object per reconcile, counted per-object through an instrumented client. See the design-phase comment below for why (a) alone is insufficient.

Depends on #1. See docs/ROADMAP.md § Phase 0.2.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions