You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This let the user specify a version constraint to choose from.
Version constraint looks like this:
```yaml
version: ">= 0.5.0"
```
This will only choose the tasks that are greater than 0.5.0
Additional constraint operators are available, for example:
```yaml
version: ">= 0.5.0, < 2.0.0"
```
This will only choose the tasks that are greater than 0.5.0 and less
than 2.0.0
Signed-off-by: Chmouel Boudjnah <[email protected]>
Copy file name to clipboardExpand all lines: docs/hub-resolver.md
+33-1
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ Use resolver type `hub`.
17
17
|`type`| The type of Hub from where to pull the resource (Optional). Either `artifact` or `tekton`| Default: `artifact`|
18
18
|`kind`| Either `task` or `pipeline` (Optional) | Default: `task`|
19
19
|`name`| The name of the task or pipeline to fetch from the hub |`golang-build`|
20
-
|`version`| Version of task or pipeline to pull in from hub. Wrap the number in quotes! |`"0.5.0"`|
20
+
|`version`| Version or a Constraint (see [below](#version-constraint)of a task or a pipeline to pull in from. Wrap the number in quotes! |`"0.5.0"`, `">= 0.5.0"`|
21
21
22
22
The Catalogs in the Artifact Hub follows the semVer (i.e.` <major-version>.<minor-version>.0`) and the Catalogs in the Tekton Hub follows the simplified semVer (i.e. `<major-version>.<minor-version>`). Both full and simplified semantic versioning will be accepted by the `version` parameter. The Hub Resolver will map the version to the format expected by the target Hub `type`.
23
23
@@ -129,6 +129,38 @@ spec:
129
129
# overall will not succeed without those parameters.
130
130
```
131
131
132
+
### Version constraint
133
+
134
+
Instead of a version you can specify a constraint to choose from. The constraint is a string as documented in the [go-version](https://github.com/hashicorp/go-version) library.
135
+
136
+
Some examples:
137
+
138
+
```yaml
139
+
params:
140
+
- name: name
141
+
value: git-clone
142
+
- name: version
143
+
value: ">=0.7.0"
144
+
```
145
+
146
+
Will only choose the git-clone task that is greater than version `0.7.0`
147
+
148
+
```yaml
149
+
params:
150
+
- name: name
151
+
value: git-clone
152
+
- name: version
153
+
value: ">=0.7.0, < 2.0.0"
154
+
```
155
+
156
+
Will select the **latest** git-clone task that is greater than version `0.7.0` and
157
+
less than version `2.0.0`, so if the latest task is the version `0.9.0` it will
158
+
be selected.
159
+
160
+
Other operators for selection are available for comparisons, see the
0 commit comments