Fix CronWorkflow CR not being updated on target ChaosInfrastructure#5524
Draft
xorjnox wants to merge 3 commits into
Draft
Fix CronWorkflow CR not being updated on target ChaosInfrastructure#5524xorjnox wants to merge 3 commits into
xorjnox wants to merge 3 commits into
Conversation
Signed-off-by: xorjnox <ranjan.s.1227@gmail.com>
Signed-off-by: xorjnox <ranjan.s.1227@gmail.com>
Signed-off-by: xorjnox <ranjan.s.1227@gmail.com>
Contributor
|
@xorjnox are you still wokring on this issue? |
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.
Proposed changes
Fix CronWorkflow CR not being updated on target ChaosInfrastructure when a ChaosExperiment is edited in ChaosCenter.
Root cause
SaveChaosExperiment in handler.go called ProcessExperimentUpdate with a hardcoded nil for StateData. In ops/service.go, the subscriber dispatch (SendExperimentToSubscriber) is gated on r != nil — so every save/edit via the UI silently updated MongoDB but never sent any message to the in-cluster subscriber. The CronWorkflow CR remained stale until manually deleted.
Fix
spec.workflowSpec, metadata). The delete payload uses the previous revision's manifest to ensure the correct CR name is targeted even if the experiment was renamed.
Types of changes
What types of changes does your code introduce to Litmus? Put an
xin the boxes that applyChecklist
Dependency
None.
Special notes for your reviewer:
The subscriber already supports delete and create request types (subscriber/pkg/k8s/operations.go) — no subscriber
changes were needed. The subscriber's delete path returns nil on IsNotFound, so a missing CR (e.g. infra was offline
during original creation) is handled gracefully. If the infra is inactive, SendRequestToSubscriber is a no-op (no
observer in ConnectedInfra), which is consistent with existing behaviour across all other mutations.
The StateData (r) parameter is nil in unit tests and the fuzz test — this is intentional and matches how all other
handler tests are written (subscriber dispatch is not tested at the handler layer).