Skip to content

Commit

Permalink
Fix a few misplaced "env" in tasks
Browse files Browse the repository at this point in the history
A few recent PRs improved on the use of params replacement, by setting
up environment variables to be used in scripts instead of resolving
params directly in there. A few "env" however have been misplaced under
the task spec directly, instead of going in a step or stepTemplate.
This PR fixes the issue.

Signed-off-by: Andrea Frittoli <[email protected]>
  • Loading branch information
afrittoli authored and tekton-robot committed Jan 13, 2022
1 parent 0ffdfe9 commit 46e9708
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
13 changes: 6 additions & 7 deletions tekton/resources/nightly-tests/base/deploy_tekton_component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ spec:
- name: extra-file
description: extra file to install (for instance, interceptors.yaml for triggers)
default: ""
env:
- name: PACKAGE
value: $(params.package)
- name: VERSION
value: $(params.version)
- name: EXTRA_FILE
value: $(params.extra-file)
workspaces:
- name: k8s-shared
description: workspace for k8s config, configuration file is expected to have `config` name
Expand All @@ -29,6 +22,12 @@ spec:
env:
- name: KUBECONFIG
value: $(workspaces.k8s-shared.path)/config
- name: PACKAGE
value: $(params.package)
- name: VERSION
value: $(params.version)
- name: EXTRA_FILE
value: $(params.extra-file)
script: |
#!/usr/bin/env sh
set -exo pipefail
Expand Down
18 changes: 9 additions & 9 deletions tekton/resources/nightly-tests/bastion-p/k8s_cluster_setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ spec:
type: string
description: create and delete actions are supported
default: create
env:
- name: REMOTE_HOST
value: $(params.remote-host)
- name: REMOTE_USER
value: $(params.remote-user)
- name: REMOTE_PORT
value: $(params.remote-port)
- name: ACTION
value: $(params.action)
steps:
- name: ssh
image: kroniak/ssh-client
env:
- name: REMOTE_HOST
value: $(params.remote-host)
- name: REMOTE_USER
value: $(params.remote-user)
- name: REMOTE_PORT
value: $(params.remote-port)
- name: ACTION
value: $(params.action)
script: |
ssh -p ${REMOTE_PORT} -o StrictHostKeyChecking=no -o LogLevel=ERROR ${REMOTE_USER}@${REMOTE_HOST} k8smanager ${ACTION}
if [ "${ACTION}" == "create" ]; then
Expand Down
15 changes: 8 additions & 7 deletions tekton/resources/release/base/prerelease_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ spec:
- name: releaseBucket
description: >-
The bucket where to look for the release, in the format gs://<bucket-name>/<project-name>
env:
- name: PACKAGE
value: $(params.package)
- name: VERSION_TAG
value: $(params.versionTag)
- name: RELEASE_BUCKET
value: $(params.releaseBucket)
stepTemplate:
env:
- name: PACKAGE
value: $(params.package)
- name: VERSION_TAG
value: $(params.versionTag)
- name: RELEASE_BUCKET
value: $(params.releaseBucket)
workspaces:
- name: source-to-release
description: The workspace where the repo has been cloned
Expand Down

0 comments on commit 46e9708

Please sign in to comment.