Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions modules/op-resolver-hub-config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ spec:
default-type: tekton
tekton-hub-api: "https://my-custom-tekton-hub.example.com"
artifact-hub-api: "https://my-custom-artifact-hub.example.com"
artifact-hub-urls: |
- https://internal-artifact-hub.example.com/
- https://artifacthub.io/
tekton-hub-urls: |
- https://internal-tekton-hub.example.com/
----
`default-tekton-hub-catalog`:: The default {tekton-hub} catalog for pulling a resource.
`default-artifact-hub-task-catalog`:: The default {artifact-hub} catalog for pulling a task resource.
Expand All @@ -44,10 +49,24 @@ spec:
`default-type`:: The default hub for pulling a resource, either `artifact` for {artifact-hub} or `tekton` for {tekton-hub}.
`tekton-hub-api`:: The {tekton-hub} API used, if you set the `default-type` option to `tekton`.
`artifact-hub-api`:: Optional: The {artifact-hub} API used, if you set the `default-type` option to `artifact`.
`artifact-hub-urls`:: Optional: Ordered YAML list of {artifact-hub} API URLs. The resolver tries each URL in order and returns the first successful response. URLs must use the `http` or `https` scheme. If not set, the resolver uses the `artifact-hub-api` value or the default URL `https://artifacthub.io`.
`tekton-hub-urls`:: Optional: Ordered YAML list of {tekton-hub} API URLs. The resolver tries each URL in order and returns the first successful response. URLs must use the `http` or `https` scheme. If not set, the resolver uses the `tekton-hub-api` value.
+
[IMPORTANT]
====
If you set the `default-type` option to `tekton`, you must configure your own instance of the {tekton-hub} by setting the `tekton-hub-api` value.
If you set the `default-type` option to `tekton`, you must configure your own instance of the {tekton-hub} by setting the `tekton-hub-api` value or the `tekton-hub-urls` list.

If you set the `default-type` option to `artifact` then the resolver uses the public hub API at https://artifacthub.io/ by default. You can configure your own {artifact-hub} API by setting the `artifact-hub-api` value.
If you set the `default-type` option to `artifact` then the resolver uses the public hub API at https://artifacthub.io/ by default. You can configure your own {artifact-hub} API by setting the `artifact-hub-api` value or the `artifact-hub-urls` list.
====
+
[NOTE]
====
The hub resolver determines which URL to use based on the following precedence order (highest to lowest):

. The `url` parameter in the pipeline run, task run, or task specification (per-resolution override)
. The `artifact-hub-urls` or `tekton-hub-urls` configuration field (tries each URL in order)
. The `artifact-hub-api` or `tekton-hub-api` configuration field (single URL)
. The default URL for {artifact-hub} (`https://artifacthub.io`)

If you specify multiple URLs in the `artifact-hub-urls` or `tekton-hub-urls` fields, the resolver tries each URL in order and returns the first successful response. This is useful for configuring fallback hubs or for environments with multiple hub instances.
====
45 changes: 45 additions & 0 deletions modules/op-resolver-hub.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ When creating a pipeline run, you can specify a remote pipeline from {artifact-h
| `version`
| The version of the task or pipeline to fetch from the hub. You must use quotes (`"`) around the number.
| `"0.5.0"`

| `url`
| Optional: Custom hub API endpoint to query instead of the cluster-configured default. Must be an absolute HTTP or HTTPS URL. When specified, this parameter overrides all other URL configuration including ConfigMap URL lists, environment variables, and defaults.
| `https://internal-hub.example.com`
|===
+
If the pipeline or task requires additional parameters, specify values for these parameters in the `params` section of the specification of the pipeline, pipeline run, or task run. The `params` section of the `pipelineRef` or `taskRef` specification must contain only the parameters that the resolver supports.
Expand Down Expand Up @@ -171,3 +175,44 @@ spec:
- name: sample-stepaction-parameter
value: test
----

The following example task run references a remote task from a private hub instance by using the `url` parameter:

[source,yaml]
----
apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
name: private-hub-task-reference
spec:
taskRef:
resolver: hub
params:
- name: url
value: https://internal-hub.example.com
- name: catalog
value: my-team-catalog
- name: type
value: artifact
- name: kind
value: task
- name: name
value: my-task
- name: version
value: "1.0.0"
params:
- name: sample-task-parameter
value: test
----
+
[NOTE]
====
When you specify the `url` parameter, it overrides all cluster-configured hub URLs, including ConfigMap URL lists and environment variables. This is useful for:

* Accessing resources from a private or internal hub instance
* Overriding the default hub for specific pipeline runs or task runs
* Testing resources from a different hub without changing cluster configuration
* Air-gapped deployments where resources are hosted on private hub instances

If you do not specify the `url` parameter, the resolver uses the cluster-configured defaults in the following precedence order: ConfigMap URL lists (`artifact-hub-urls` or `tekton-hub-urls`), environment variables (`ARTIFACT_HUB_API` or `TEKTON_HUB_API`), or the default URL.
====