|
6 | 6 | has(pipelineRun.spec.params) &&
|
7 | 7 | pipelineRun.spec.params.exists(p, p.name == 'build-platforms') ?
|
8 | 8 | pipelineRun.spec.params.filter(
|
9 |
| - p, |
| 9 | + p, |
10 | 10 | p.name == 'build-platforms')[0]
|
11 | 11 | .value.map(
|
12 | 12 | p,
|
13 |
| - annotation("kueue.konflux-ci.dev/requests-" + replace(replace(p, "/", "-"), "_", "-"), "1") |
| 13 | + resource(replace(replace(p, "/", "-"), "_", "-"), 1) |
| 14 | + ) : [] |
| 15 | +
|
| 16 | + # Request AWS IP for AWS-based platforms |
| 17 | + - | |
| 18 | + has(pipelineRun.spec.params) && |
| 19 | + pipelineRun.spec.params.exists(p, p.name == 'build-platforms') ? |
| 20 | + pipelineRun.spec.params.filter( |
| 21 | + p, |
| 22 | + p.name == 'build-platforms')[0] |
| 23 | + .value.filter( |
| 24 | + p, |
| 25 | + !( |
| 26 | + p in [ |
| 27 | + 'linux/ppc64le', |
| 28 | + 'linux/s390x', |
| 29 | + 'linux/x86_64', |
| 30 | + 'local', |
| 31 | + 'localhost', |
| 32 | + ] |
| 33 | + ) |
| 34 | + ).map( |
| 35 | + p, |
| 36 | + resource('aws-ip', 1) |
14 | 37 | ) : []
|
15 | 38 |
|
16 | 39 | # Set resource requests for multi platform pipelines which doesn't use the build-platforms parameter (old style)
|
|
24 | 47 | .filter(p, p.size() > 0)
|
25 | 48 | .map(
|
26 | 49 | p,
|
27 |
| - annotation("kueue.konflux-ci.dev/requests-" + replace(replace(p[0].value, "/", "-"), "_", "-"), "1") |
| 50 | + resource(replace(replace(p[0].value, "/", "-"), "_", "-"), 1) |
| 51 | + ) : [] |
| 52 | +
|
| 53 | + # Request AWS IP for AWS-based platforms which doesn't use the build-platforms parameter (old style) |
| 54 | + - | |
| 55 | + has(pipelineRun.spec.pipelineSpec) && |
| 56 | + pipelineRun.spec.pipelineSpec.tasks.size() > 0 ? |
| 57 | + pipelineRun.spec.pipelineSpec.tasks.map( |
| 58 | + task, |
| 59 | + has(task.params) ? task.params.filter(p, p.name == 'PLATFORM') : [] |
| 60 | + ) |
| 61 | + .filter(p, p.size() > 0) |
| 62 | + .filter( |
| 63 | + p, |
| 64 | + !( |
| 65 | + p[0].value in [ |
| 66 | + 'linux/ppc64le', |
| 67 | + 'linux/s390x', |
| 68 | + 'linux/x86_64', |
| 69 | + 'local', |
| 70 | + 'localhost', |
| 71 | + ] |
| 72 | + ) |
| 73 | + ) |
| 74 | + .map( |
| 75 | + p, |
| 76 | + resource('aws-ip', 1) |
28 | 77 | ) : []
|
29 | 78 |
|
30 | 79 | # Set the pipeline priority
|
|
0 commit comments