Skip to content

Commit

Permalink
fix: get tektonconfig version from label
Browse files Browse the repository at this point in the history
When the `managedFields` field is present in the TektonConfig CR, the
`kubectl get tektonconfig config -o yaml` command returns multiple
`operator.tekton.dev/release-version` labels. This causes the
`tektonconfig_version_from_label` function to return an incorrect
version. This commit fixes the issue by adding a `head -n 1` command
to the `grep` command in the `tektonconfig_version_from_label` function.
  • Loading branch information
l-qing authored and tekton-robot committed Jan 20, 2025
1 parent f547f09 commit 8039f5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function current_tektonconfig_version() {

function tektonconfig_version_from_label() {
label_key='operator.tekton.dev/release-version'
kubectl get tektonconfig config -o yaml | grep ${label_key} | tr -d ' ' | cut -d ':' -f 2
kubectl get tektonconfig config -o yaml | grep ${label_key} | head -n 1 | tr -d ' ' | cut -d ':' -f 2
}

tektonconfig_version_from_status() {
Expand Down

0 comments on commit 8039f5b

Please sign in to comment.