-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tasks): Add registry info task (#53)
This new task makes it possible to create pipelines that perform registry replacements on the fly. Also makes it possible to perform image synchronization.
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: ClusterTask | ||
metadata: | ||
name: oc-registry-info | ||
annotations: | ||
description: | | ||
Get registry info from an OpenShift cluster. | ||
spec: | ||
params: | ||
- name: context | ||
type: string | ||
description: | | ||
The name of the context from kubeconfig to ask for registry info. | ||
results: | ||
- name: internal | ||
description: | ||
Internal registry URL. | ||
- name: public | ||
description: | ||
Public registry URL. | ||
steps: | ||
- name: oc-registry-info | ||
image: quay.io/konveyor/crane-runner:latest | ||
script: | | ||
oc --context="$(params.context)" registry info --internal | tee $(results.internal.path) | ||
( oc --context="$(params.context)" registry info --public || \ | ||
oc --context="$(params.context)" get route default-route -n openshift-image-registry --template='{{ .spec.host }}' || \ | ||
oc --context="$(params.context)" get route docker-registry -n default --template='{{ .spec.host }}' \ | ||
) | tee $(results.public.path) | ||
env: | ||
- name: KUBECONFIG | ||
value: $(workspaces.kubeconfig.path)/kubeconfig | ||
workspaces: | ||
- name: kubeconfig | ||
description: | | ||
The kubeconfig for accessing the cluster. |