Skip to content

Commit 16c864b

Browse files
authored
kueue: skip old platform param if new param exists in production (#9125)
If both the old and the new platform params exist in the pipelinerun, we should only pull from the new platform params. The old parameters are likely going to be something we can't interpret with CEL expressions if the new paramter is set. To avoid issues, only read from the old expressions if the new expressions are not set. See KONFLUX-9917 for issues that have already cropped up in our production clusters. Fixes: KONFLUX-9917 Signed-off-by: Andy Sadler <[email protected]>
1 parent 72cc19c commit 16c864b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

components/kueue/production/base/tekton-kueue/config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ cel:
3838
3939
# Set resource requests for multi platform pipelines which doesn't use the build-platforms parameter (old style)
4040
- |
41+
!(
42+
has(pipelineRun.spec.params) &&
43+
pipelineRun.spec.params.exists(p, p.name == 'build-platforms')
44+
) &&
4145
has(pipelineRun.spec.pipelineSpec) &&
4246
has(pipelineRun.spec.pipelineSpec.tasks) &&
4347
pipelineRun.spec.pipelineSpec.tasks.size() > 0 ?
@@ -53,6 +57,10 @@ cel:
5357
5458
# Request AWS IP for AWS-based platforms which doesn't use the build-platforms parameter (old style)
5559
- |
60+
!(
61+
has(pipelineRun.spec.params) &&
62+
pipelineRun.spec.params.exists(p, p.name == 'build-platforms')
63+
) &&
5664
has(pipelineRun.spec.pipelineSpec) &&
5765
has(pipelineRun.spec.pipelineSpec.tasks) &&
5866
pipelineRun.spec.pipelineSpec.tasks.size() > 0 ?

hack/test-tekton-kueue-config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,10 @@ def check_prerequisites(should_print: bool = True) -> Dict[str, TestConfig]:
769769
"pipelinerun_key": "mintmaker",
770770
"config_key": "production"
771771
},
772+
"prefer_new_parameters_staging": {
773+
"pipelinerun_key": "prefer-new-parameters",
774+
"config_key": "production"
775+
},
772776

773777
# Example: Test the same PipelineRun with different configs to show reusability
774778
"user-specific-priority_and_mixed_platforms_production-kflux-ocp-p01": {

0 commit comments

Comments
 (0)