Skip to content

Commit

Permalink
fix(KFLUXSPRT-794): pass content-gateway token as env var (#726)
Browse files Browse the repository at this point in the history
- Change name of CGW_TOKEN to CGW_PASSWORD
  - This is actually a token, no pw, but the pubtools library expects
    this environment variable name
- No longer pass token with command invocation

Signed-off-by: Scott Wickersham <[email protected]>
  • Loading branch information
swickersh authored Dec 12, 2024
1 parent 4442af2 commit 4f48923
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions tasks/publish-to-cgw/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Tekton task to publish content to Red Hat's Developer portal using pubtools-cont
| cgwHostname | The hostname of the content-gateway to publish the metadata to | yes | https://developers.redhat.com/content-gateway/rest/admin |
| cgwSecret | The kubernetes secret to use to authenticate to content-gateway | yes | publish-to-cgw-secret |

## Changes in 0.2.6
* Invoke Content Gateway without password in command

## Changes in 0.2.5
* Support pushes to mirror.openshift.com (ShortUrl)

Expand Down
6 changes: 3 additions & 3 deletions tasks/publish-to-cgw/publish-to-cgw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Task
metadata:
name: publish-to-cgw
labels:
app.kubernetes.io/version: "0.2.5"
app.kubernetes.io/version: "0.2.6"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/tags: release
Expand Down Expand Up @@ -47,7 +47,7 @@ spec:
secretKeyRef:
name: $(params.cgwSecret)
key: username
- name: CGW_TOKEN
- name: CGW_PASSWORD
valueFrom:
secretKeyRef:
name: $(params.cgwSecret)
Expand Down Expand Up @@ -183,11 +183,11 @@ spec:
yaml.dump(metadata, file, default_flow_style=False, sort_keys=False)
print(f"YAML content dumped to {METADATA_FILE_PATH}")
command = [
'push-cgw-metadata',
'--CGW_hostname', '$(params.cgwHostname)',
'--CGW_username', '${CGW_USERNAME}',
'--CGW_password', '${CGW_TOKEN}',
'--CGW_filepath', METADATA_FILE_PATH
]
Expand Down

0 comments on commit 4f48923

Please sign in to comment.