Feat/integration fluxcd#42
Merged
Merged
Conversation
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Adds FluxCD integration for
LightsOutScheduleandLightsOutNamespaceSchedule. 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
analyzeScheduleFrequencythat caused yearly cron schedules to compute the wrong state after ~90 days past their last occurrence.Changes
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 viarbac.fluxcd: true. Added ownership guard to prevent tagging unmanaged Flux resources during upscale reconciliation (handleFluxCDWarmup).frequencyRare(400-day window) instead offrequencyMonthly(90-day window), fixing wrong state calculation for yearly schedules after ~90 days (period.go).docs/fluxcd.md.Testing
period_test.goregression test for the yearly cron frequency bug.time.Now()calls in tests replaced with fixedtime.Date(...)values.Checklist
make lintpassesmake testpassesmake manifests generaterun if API types changedmake helm-crdsrun if CRDs changed