fix: include maxConcurrentJobs in ConfigSpec.Equal so config edits apply without restart - #20
Merged
Merged
Conversation
…ply without restart
There was a problem hiding this comment.
I now have all the information needed. Let me compile the findings.
What this PR changes:
types.go:168— addss.MaxConcurrentJobs == o.MaxConcurrentJobstoConfigSpec.Equaltypes_test.go:285-317— addsDescribe("Equal - maxConcurrentJobs", ...)with two Ginkgo It blocksCHANGELOG.md— documents the fix
Mechanical findings (ast-grep funnel, pre-computed) — all are pre-existing in the codebase, not introduced by this PR. The single-line Equal addition follows the exact same pattern as every other field in that method.
Manual review of the diff:
- The new test correctly covers the two cases: Equal returns false when values differ, true when identical
- The Equal implementation is correct — value equality via
==is consistent with all other scalar fields in that method (Assignee, Image, Heartbeat, TaskType, SecretName, VolumeClaim, VolumeMountPath, PriorityClassName, MaxConcurrentJobs) - The CHANGELOG entry is clear and explains the bug (Config watch cache was ignoring
maxConcurrentJobsedits until restart)
Pre-existing issues not introduced by this PR:
- Missing
*_suite_test.gofor the Ginkgo test suite (noted in funnel) SecretNamefield lackingdisplay:"length"tag (noted in funnel)reflect.DeepEqualanderrors.Wrapfdirect package calls in business logic (pre-existing)
The PR is correct and focused. No issues introduced.
{
"verdict": "approve",
"summary": "The single-line addition of MaxConcurrentJobs to ConfigSpec.Equal is correct, follows the existing field-comparison pattern exactly, and is backed by a proper Ginkgo test covering both false-when-different and true-when-identical cases. The CHANGELOG entry clearly explains the bug and its user-visible impact. All mechanical findings are pre-existing issues in the codebase, not introduced by this change.",
"comments": [],
"concerns_addressed": [
"correctness: MaxConcurrentJobs comparison added to ConfigSpec.Equal at types.go:168 — follows existing scalar field pattern",
"tests: new Ginkgo Describe block 'Equal - maxConcurrentJobs' covers both false-when-different and true-when-matching cases"
]
}Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
What
k8s/apis/agent.benjamin-borbe.de/v1/types.go: adds.MaxConcurrentJobs == o.MaxConcurrentJobstoConfigSpec.Equal.types_test.go: regression test ("Equal - maxConcurrentJobs") — false when only this field differs, true when identical.Why
The executor's Config watch cache (
eventHandlerAlert.OnUpdate, github.com/bborbe/k8s) callsEqualto decide whether a Config changed.MaxConcurrentJobswas missing from the comparison, so amaxConcurrentJobs-only edit to a live Config CR was treated as "nothing changed => skip update" and had no effect until the executor pod restarted.Measured in prod 2026-08-18: CR patched
maxConcurrentJobs: 1 -> 3at ~21:00, executor still loggedcap=1at 21:09, and only took effect after a rollout restart at ~21:12 forced a full informer re-sync.Verified
make testPASS (all packages; includes the newEqual - maxConcurrentJobscases).Deploy tail
make build/make uploadat the release tag).EXECUTOR_VERSIONpin inquant/agent+ chart version if needed.BRANCH=dev make applythenBRANCH=prod make apply(restart is inherent in the deploy).