Skip to content

Commit 1c93985

Browse files
committed
Add new yaml target
- Add a new target 'yq-sort-and-format` to standardize the yaml files - Apply the target to the existing files
1 parent ded4ed2 commit 1c93985

File tree

10 files changed

+502
-517
lines changed

10 files changed

+502
-517
lines changed

.github/workflows/rust.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
---
2-
name: Rust
3-
4-
on: # yamllint disable-line rule:truthy
5-
push:
6-
branches: ["main"]
7-
pull_request:
8-
branches: ["main"]
9-
102
jobs:
113
build:
12-
134
runs-on: ubuntu-latest
14-
155
steps:
166
- uses: actions/checkout@v4
177
with:
188
submodules: recursive
199
- name: Run rust-ci job
2010
run: make rust-ci
11+
name: Rust
12+
on: # yamllint disable-line rule:truthy
13+
pull_request:
14+
branches:
15+
- main
16+
push:
17+
branches:
18+
- main

.github/workflows/yamllint.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
---
2-
name: Yamllint
3-
4-
on: # yamllint disable-line rule:truthy
5-
push:
6-
branches: ["main"]
7-
pull_request:
8-
branches: ["main"]
9-
102
jobs:
113
build:
12-
134
runs-on: ubuntu-latest
14-
155
steps:
166
- uses: actions/checkout@v4
177
with:
188
submodules: recursive
199
- name: Run yamllint
2010
run: make yamllint
11+
name: Yamllint
12+
on: # yamllint disable-line rule:truthy
13+
pull_request:
14+
branches:
15+
- main
16+
push:
17+
branches:
18+
- main

.konflux/lock-build/rpms.in.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
2+
arches:
3+
- x86_64
4+
- aarch64
25
contentOrigin:
36
repofiles:
47
# rhel9 rpm repos
58
- ./redhat.repo
6-
packages:
7-
- rust-toolset
8-
- protobuf-compiler
9-
arches:
10-
- x86_64
11-
- aarch64
129
context:
1310
containerfile:
1411
file: ../Dockerfile
1512
stageName: build-image
13+
packages:
14+
- rust-toolset
15+
- protobuf-compiler

.konflux/lock-build/rpms.lock.yaml

Lines changed: 236 additions & 236 deletions
Large diffs are not rendered by default.

.konflux/lock-runtime/rpms.in.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2+
arches:
3+
- x86_64
4+
- aarch64
25
contentOrigin:
36
repofiles:
47
# rhel9 rpm repos
58
- ./redhat.repo
6-
packages:
7-
- openssh-clients
8-
arches:
9-
- x86_64
10-
- aarch64
119
context:
1210
containerfile:
1311
file: ../Dockerfile
1412
stageName: runtime-image
13+
packages:
14+
- openssh-clients

.konflux/lock-runtime/rpms.lock.yaml

Lines changed: 148 additions & 148 deletions
Large diffs are not rendered by default.

.tekton/build-pipeline.yaml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ spec:
2727
- description: Source Repository URL
2828
name: git-url
2929
type: string
30-
- default: ''
30+
- default: ""
3131
description: Revision of the Source Repository
3232
name: revision
3333
type: string
@@ -42,54 +42,54 @@ spec:
4242
description: Path to the Dockerfile inside the context specified by parameter path-context
4343
name: dockerfile
4444
type: string
45-
- default: 'false'
45+
- default: "false"
4646
description: Force rebuild image
4747
name: rebuild
4848
type: string
49-
- default: 'false'
49+
- default: "false"
5050
description: Skip checks against built image
5151
name: skip-checks
5252
type: string
53-
- default: 'false'
53+
- default: "false"
5454
description: Skip the ecosystem preflight checks (bundles should skip)
5555
name: skip-preflight
5656
type: string
57-
- default: 'false'
57+
- default: "false"
5858
description: Skip the sast coverity check
5959
name: skip-sast-coverity
6060
type: string
61-
- default: 'false'
61+
- default: "false"
6262
description: Execute the build with network isolation
6363
name: hermetic
6464
type: string
65-
- default: ''
65+
- default: ""
6666
description: Build dependencies to be prefetched by Cachi2
6767
name: prefetch-input
6868
type: string
69-
- default: 'false'
69+
- default: "false"
7070
description: Enable dev-package-manager within prefetching task
7171
name: dev-package-managers
7272
type: string
73-
- default: ''
73+
- default: ""
7474
description: Image tag expiration time, time values could be something like 1h, 2d, 3w for hours, days, and weeks, respectively.
7575
name: image-expires-after
76-
- default: 'false'
76+
- default: "false"
7777
description: Build a source image.
7878
name: build-source-image
7979
type: string
80-
- default: 'true'
80+
- default: "true"
8181
description: Add built image into an OCI image index
8282
name: build-image-index
8383
type: string
8484
- default: []
8585
description: Array of --build-arg values ("arg=value" strings) for buildah
8686
name: build-args
8787
type: array
88-
- default: ''
88+
- default: ""
8989
description: Path to a file with build arguments for buildah, see https://www.mankier.com/1/buildah-build#--build-arg-file
9090
name: build-args-file
9191
type: string
92-
- default: 'false'
92+
- default: "false"
9393
description: Whether to enable privileged mode, should be used only with remote VMs
9494
name: privileged-nested
9595
type: string
@@ -103,16 +103,16 @@ spec:
103103
name: additional-tags
104104
type: array
105105
results:
106-
- description: ''
106+
- description: ""
107107
name: IMAGE_URL
108108
value: $(tasks.build-image-index.results.IMAGE_URL)
109-
- description: ''
109+
- description: ""
110110
name: IMAGE_DIGEST
111111
value: $(tasks.build-image-index.results.IMAGE_DIGEST)
112-
- description: ''
112+
- description: ""
113113
name: CHAINS-GIT_URL
114114
value: $(tasks.clone-repository.results.url)
115-
- description: ''
115+
- description: ""
116116
name: CHAINS-GIT_COMMIT
117117
value: $(tasks.clone-repository.results.commit)
118118
tasks:
@@ -158,7 +158,7 @@ spec:
158158
- input: $(tasks.init.results.build)
159159
operator: in
160160
values:
161-
- 'true'
161+
- "true"
162162
workspaces:
163163
- name: basic-auth
164164
workspace: git-auth
@@ -243,7 +243,7 @@ spec:
243243
- name: CACHI2_ARTIFACT
244244
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
245245
- name: IMAGE_APPEND_PLATFORM
246-
value: 'true'
246+
value: "true"
247247
- name: LABELS
248248
value:
249249
- $(tasks.generate-labels.results.labels[*])
@@ -274,7 +274,7 @@ spec:
274274
- input: $(tasks.init.results.build)
275275
operator: in
276276
values:
277-
- 'true'
277+
- "true"
278278
- name: build-image-index
279279
params:
280280
- name: IMAGE
@@ -303,7 +303,7 @@ spec:
303303
- input: $(tasks.init.results.build)
304304
operator: in
305305
values:
306-
- 'true'
306+
- "true"
307307
- name: build-source-image
308308
params:
309309
- name: BINARY_IMAGE
@@ -329,11 +329,11 @@ spec:
329329
- input: $(tasks.init.results.build)
330330
operator: in
331331
values:
332-
- 'true'
332+
- "true"
333333
- input: $(params.build-source-image)
334334
operator: in
335335
values:
336-
- 'true'
336+
- "true"
337337
- name: deprecated-base-image-check
338338
params:
339339
- name: IMAGE_URL
@@ -355,7 +355,7 @@ spec:
355355
- input: $(params.skip-checks)
356356
operator: in
357357
values:
358-
- 'false'
358+
- "false"
359359
- name: clair-scan
360360
params:
361361
- name: image-digest
@@ -377,7 +377,7 @@ spec:
377377
- input: $(params.skip-checks)
378378
operator: in
379379
values:
380-
- 'false'
380+
- "false"
381381
- name: ecosystem-cert-preflight-checks
382382
params:
383383
- name: image-url
@@ -397,11 +397,11 @@ spec:
397397
- input: $(params.skip-checks)
398398
operator: in
399399
values:
400-
- 'false'
400+
- "false"
401401
- input: $(params.skip-preflight)
402402
operator: in
403403
values:
404-
- 'false'
404+
- "false"
405405
- name: sast-snyk-check
406406
params:
407407
- name: image-digest
@@ -427,7 +427,7 @@ spec:
427427
- input: $(params.skip-checks)
428428
operator: in
429429
values:
430-
- 'false'
430+
- "false"
431431
- name: clamav-scan
432432
params:
433433
- name: image-digest
@@ -449,7 +449,7 @@ spec:
449449
- input: $(params.skip-checks)
450450
operator: in
451451
values:
452-
- 'false'
452+
- "false"
453453
- name: sast-coverity-check
454454
# This task is optional per Product Security
455455
onError: continue
@@ -496,11 +496,11 @@ spec:
496496
- input: $(params.skip-checks)
497497
operator: in
498498
values:
499-
- 'false'
499+
- "false"
500500
- input: $(params.skip-sast-coverity)
501501
operator: in
502502
values:
503-
- 'false'
503+
- "false"
504504
- input: $(tasks.coverity-availability-check.results.STATUS)
505505
operator: in
506506
values:
@@ -521,11 +521,11 @@ spec:
521521
- input: $(params.skip-checks)
522522
operator: in
523523
values:
524-
- 'false'
524+
- "false"
525525
- input: $(params.skip-sast-coverity)
526526
operator: in
527527
values:
528-
- 'false'
528+
- "false"
529529
- name: sast-shell-check
530530
params:
531531
- name: image-digest
@@ -551,7 +551,7 @@ spec:
551551
- input: $(params.skip-checks)
552552
operator: in
553553
values:
554-
- 'false'
554+
- "false"
555555
- name: sast-unicode-check
556556
params:
557557
- name: image-digest
@@ -577,7 +577,7 @@ spec:
577577
- input: $(params.skip-checks)
578578
operator: in
579579
values:
580-
- 'false'
580+
- "false"
581581
- name: apply-tags
582582
params:
583583
- name: ADDITIONAL_TAGS
@@ -641,7 +641,7 @@ spec:
641641
- input: $(params.skip-checks)
642642
operator: in
643643
values:
644-
- 'false'
644+
- "false"
645645
workspaces:
646646
- name: git-auth
647647
optional: true

.yamllint.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
extends: default
3-
43
ignore:
54
- vendor/
6-
75
rules:
86
line-length: disable

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@ yamllint: ## Download yamllint and lint YAML files in the repository
4444
yamllint -c $(ROOT_DIR)/.yamllint.yaml .
4545
@echo "YAML linting completed successfully."
4646

47+
.PHONY: yq
48+
yq: ## Download yq
49+
@echo "Downloading yq..."
50+
$(MAKE) -C $(ROOT_DIR)/telco5g-konflux/scripts/download download-yq DOWNLOAD_INSTALL_DIR=$(ROOT_DIR)/bin
51+
@echo "Yq downloaded successfully."
52+
53+
.PHONY: yq-sort-and-format
54+
yq-sort-and-format: yq ## Sort keys/reformat all YAML files in the repository
55+
@echo "Sorting keys and reformatting YAML files..."
56+
@find . -name "*.yaml" -o -name "*.yml" | grep -v -E "(telco5g-konflux/|target/|vendor/|bin/|\.git/)" | while read file; do \
57+
echo "Processing $$file..."; \
58+
yq -i '.. |= sort_keys(.)' "$$file"; \
59+
done
60+
@echo "YAML sorting and formatting completed successfully."
61+
4762
.PHONY: konflux-all
4863
konflux-all: konflux-filter-unused-redhat-repos konflux-update-tekton-task-refs ## Run all Konflux-related targets
4964
@echo "All Konflux targets completed successfully."

0 commit comments

Comments
 (0)