feat: add LabelMatchMode field to Workload struct #510
+4,035
−8
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 this PR does / why we need it:
This PR implements the prerequisite changes in chaos-operator to support label intersection mode for precise pod targeting in chaos experiments. This is required for the litmus-go PR #777 which adds the actual intersection logic for pod selection.
Changes Made:
LabelMatchModefield toApplicationParamsstruct (for appinfo-based targeting)LabelMatchModefield toWorkloadstruct (for workload-based targeting)getTargets()function to append the label match mode (union/intersection) as a 4th parameter to theTARGETSenvironment variablelabelMatchModefield in the OpenAPI schemaconfig/crd/bases/)TARGETS Environment Variable Format:
labelMatchModedefaults tounion(OR logic - matches ANY label)intersection(AND logic - matches ALL labels)Example:
Which issue this PR fixes: fixes litmuschaos/litmus-go#774
Special notes for your reviewer:
TARGETSenv variableconfig/crd/bases/(modern Kubebuilder structure) while keepingdeploy/crds/for backward compatibilityunionbehaviorChecklist:
documentationtagbreaking-changestag - Not applicable (backward compatible)requires-upgradetag - Not applicable (optional field with default)Related PRs: