Skip to content

Feat/integration fluxcd#42

Merged
gjorgji-ts merged 5 commits into
mainfrom
feat/integration-fluxcd
Apr 18, 2026
Merged

Feat/integration fluxcd#42
gjorgji-ts merged 5 commits into
mainfrom
feat/integration-fluxcd

Conversation

@gjorgji-ts

Copy link
Copy Markdown
Owner

Motivation

Adds FluxCD integration for LightsOutSchedule and LightsOutNamespaceSchedule. Without suspension, FluxCD reconciles workloads back to their git-defined replica counts within one reconcile interval, silently undoing downscale operations.

Also fixes a pre-existing bug in analyzeScheduleFrequency that caused yearly cron schedules to compute the wrong state after ~90 days past their last occurrence.

Changes

  • FluxCD integration (internal/controller/fluxcd.go) suspends matching Kustomization and HelmRelease resources on downscale. Resumes with a warming-up grace period on upscale. Supports cluster-wide (spec.targetNamespace) and co-located (resource lives in target namespace) discovery patterns. RBAC is opt-in via rbac.fluxcd: true. Added ownership guard to prevent tagging unmanaged Flux resources during upscale reconciliation (handleFluxCDWarmup).
  • Any cron with a single specific month now returns frequencyRare (400-day window) instead of frequencyMonthly (90-day window), fixing wrong state calculation for yearly schedules after ~90 days (period.go).
  • Updated README, architecture, security model, setup guide. Added docs/fluxcd.md.

Testing

  • Unit tests added for all FluxCD functions.
  • period_test.go regression test for the yearly cron frequency bug.
  • All time.Now() calls in tests replaced with fixed time.Date(...) values.

Checklist

  • Tests added / updated
  • Docs updated if behaviour changed
  • make lint passes
  • make test passes
  • make manifests generate run if API types changed
  • make helm-crds run if CRDs changed

@gjorgji-ts gjorgji-ts self-assigned this Apr 5, 2026
@gjorgji-ts gjorgji-ts added the enhancement New feature or request label Apr 5, 2026
@gjorgji-ts gjorgji-ts linked an issue Apr 5, 2026 that may be closed by this pull request
@gjorgji-ts gjorgji-ts merged commit 8a864a9 into main Apr 18, 2026
3 checks passed
@gjorgji-ts gjorgji-ts deleted the feat/integration-fluxcd branch April 18, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration - FluxCD

1 participant