HTTP Resolver

This resolver responds to type http.

Parameters

Param Name Description Example Value
url The URL to fetch from https://raw.githubusercontent.com/tektoncd-catalog/git-clone/main/task/git-clone/git-clone.yaml
http-username An optional username when fetching a task with credentials (need to be used in conjunction with http-password-secret) git
http-password-secret An optional secret in the PipelineRun namespace with a reference to a password when fetching a task with credentials (need to be used in conjunction with http-username) http-password
http-password-secret-key An optional key in the http-password-secret to be used when fetching a task with credentials Default: password
digest An optional digest to verify the integrity of the fetched content. The value must be in the format <algorithm>:<hash>, where the supported algorithms are sha256 and sha512. sha256:f37cdd0e86...

You can calculate the hash of your Tekton resource using the following command:

# Calculate sha256 digest
curl -sL https://raw.githubusercontent.com/owner/private-repo/main/task/task.yaml | sha256sum

# Calculate sha512 digest
curl -sL https://raw.githubusercontent.com/owner/private-repo/main/task/task.yaml | sha512sum


`sha265sum` and `sha512sum` are available on all major Linux distributions and macOS

A valid URL must be provided. Only HTTP or HTTPS URLs are supported.

Requirements

  • A cluster running Tekton Pipeline v0.41.0 or later.
  • The built-in remote resolvers installed.
  • The enable-http-resolver feature flag in the resolvers-feature-flags ConfigMap in the tekton-pipelines-resolvers namespace set to true.
  • Beta features enabled.

Configuration

This resolver uses a ConfigMap for its settings. See ../config/resolvers/http-resolver-config.yaml for the name, namespace and defaults that the resolver ships with.

Options

Option Name Description Example Values
fetch-timeout The maximum time any fetching of URL resolution may take. Note: a global maximum timeout of 1 minute is currently enforced on all resolution requests. 1m, 2s, 700ms

Usage

Task Resolution

apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: remote-task-reference
spec:
  taskRef:
    resolver: http
    params:
    - name: url
      value: https://raw.githubusercontent.com/tektoncd-catalog/git-clone/main/task/git-clone/git-clone.yaml

Task Resolution with Basic Auth

apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: remote-task-reference
spec:
  taskRef:
    resolver: http
    params:
    - name: url
      value: https://raw.githubusercontent.com/owner/private-repo/main/task/task.yaml
    - name: http-username
      value: git
    - name: http-password-secret
      value: git-secret
    - name: http-password-secret-key
      value: git-token

Pipeline Resolution

apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  name: http-demo
spec:
  pipelineRef:
    resolver: http
    params:
    - name: url
      value: https://raw.githubusercontent.com/tektoncd/catalog/main/pipeline/build-push-gke-deploy/0.1/build-push-gke-deploy.yaml

Pipeline Resolution with Digest

apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  name: http-demo
spec:
  pipelineRef:
    resolver: http
    params:
      - name: url
        value: https://raw.githubusercontent.com/tektoncd/catalog/main/pipeline/build-push-gke-deploy/0.1/build-push-gke-deploy.yaml
      - name: digest
        value: sha256:e1a86b942e85ce5558fc737a3b4a82d7425ca392741d20afa3b7fb426e96c66b

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License.