-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pipeline has inputs fields which can be read by runTemplates
Co-authored-by: Waciuma Wanjohi <lwanjohi@pivotal.io> Co-authored-by: Todd Ritchie <tritchie@vmware.com> [#81]
- Loading branch information
1 parent
fe16d8b
commit 49e55fb
Showing
12 changed files
with
308 additions
and
9 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,29 @@ | ||
# Copyright 2021 VMware | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- | ||
|
||
apiVersion: carto.run/v1alpha1 | ||
kind: Deliverable | ||
value: | ||
object: | ||
nested: hi | ||
still-nested: bye | ||
list: | ||
- position: one | ||
val: first | ||
- position: two | ||
val: second | ||
string: silly | ||
int: 3 |
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 @@ | ||
# Copyright 2021 VMware | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
apiVersion: carto.run/v1alpha1 | ||
kind: Pipeline | ||
metadata: | ||
name: my-pipeline | ||
labels: | ||
my-label: this-is-it | ||
my-other-label: bye | ||
spec: | ||
runTemplateRef: | ||
name: my-run-template-inputs | ||
|
||
inputs: | ||
some-object: | ||
nested: hi | ||
still-nested: bye | ||
some-list: | ||
- position: one | ||
val: first | ||
- position: two | ||
val: second | ||
some-int: 3 | ||
some-string: silly |
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,30 @@ | ||
# Copyright 2021 VMware | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- | ||
apiVersion: carto.run/v1alpha1 | ||
kind: RunTemplate | ||
metadata: | ||
name: my-run-template-inputs | ||
spec: | ||
template: | ||
apiVersion: carto.run/v1alpha1 | ||
kind: Deliverable | ||
metadata: | ||
generateName: my-stamped-resource-inputs- | ||
value: | ||
object: $(pipeline.spec.inputs.some-object)$ | ||
list: $(pipeline.spec.inputs.some-list)$ | ||
string: $(pipeline.spec.inputs.some-string)$ | ||
int: $(pipeline.spec.inputs.some-int)$ |
30 changes: 30 additions & 0 deletions
30
tests/kuttl/pipelines-driven-by-supply-chain/00-run-template.yaml
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,30 @@ | ||
# Copyright 2021 VMware | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- | ||
apiVersion: carto.run/v1alpha1 | ||
kind: RunTemplate | ||
metadata: | ||
name: my-run-template-inputs | ||
spec: | ||
template: | ||
apiVersion: carto.run/v1alpha1 | ||
kind: Deliverable | ||
metadata: | ||
generateName: my-stamped-resource-inputs- | ||
value: | ||
url: $(pipeline.spec.inputs.source-url)$ | ||
revision: $(pipeline.spec.inputs.source-revision)$ | ||
some-object-def: $(pipeline.spec.inputs.definition)$ | ||
some-hard-coded-info: not-from-the-pipeline |
61 changes: 61 additions & 0 deletions
61
tests/kuttl/pipelines-driven-by-supply-chain/00-templates.yaml
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,61 @@ | ||
# Copyright 2021 VMware | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- | ||
apiVersion: carto.run/v1alpha1 | ||
kind: ClusterSourceTemplate | ||
metadata: | ||
name: source---pipelines-driven-by-supply-chain | ||
spec: | ||
template: | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: example-first-configmap | ||
data: | ||
url: $(workload.spec.source.git.url)$ | ||
branch: "main" | ||
urlPath: data.url | ||
revisionPath: data.branch | ||
|
||
--- | ||
apiVersion: carto.run/v1alpha1 | ||
kind: ClusterSourceTemplate | ||
metadata: | ||
name: pipeline---pipelines-driven-by-supply-chain | ||
spec: | ||
# TODO: update in story 4 | ||
urlPath: .spec.runTemplateRef.name | ||
revisionPath: .spec.runTemplateRef.name | ||
|
||
params: | ||
- name: expected-param | ||
default: | ||
key: value | ||
|
||
template: | ||
apiVersion: carto.run/v1alpha1 | ||
kind: Pipeline | ||
metadata: | ||
name: my-pipeline | ||
labels: | ||
my-label: this-is-it | ||
spec: | ||
runTemplateRef: | ||
name: my-run-template-inputs | ||
|
||
inputs: | ||
source-url: $(source.url)$ | ||
source-revision: $(source.revision)$ | ||
definition: $(params.expected-param)$ |
38 changes: 38 additions & 0 deletions
38
tests/kuttl/pipelines-driven-by-supply-chain/01-supply-chain.yaml
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,38 @@ | ||
# Copyright 2021 VMware | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- | ||
apiVersion: carto.run/v1alpha1 | ||
kind: ClusterSupplyChain | ||
metadata: | ||
name: supply-chain---pipelines-driven-by-supply-chain | ||
spec: | ||
selector: | ||
integration-test: "pipelines-driven-by-supply-chain" | ||
components: | ||
- name: source-provider | ||
templateRef: | ||
kind: ClusterSourceTemplate | ||
name: source---pipelines-driven-by-supply-chain | ||
|
||
- name: pipeline-provider | ||
templateRef: | ||
kind: ClusterSourceTemplate | ||
name: pipeline---pipelines-driven-by-supply-chain | ||
sources: | ||
- component: source-provider | ||
name: source-provider | ||
params: | ||
- name: expected-param | ||
value: $(workload.spec.params[0].value)$ |
29 changes: 29 additions & 0 deletions
29
tests/kuttl/pipelines-driven-by-supply-chain/02-assert.yaml
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,29 @@ | ||
# Copyright 2021 VMware | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- | ||
|
||
apiVersion: carto.run/v1alpha1 | ||
kind: Deliverable | ||
value: | ||
url: https://github.com/spring-projects/spring-petclinic.git | ||
revision: main | ||
some-object-def: | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: some-configmap | ||
data: | ||
an-ice-cream-flavor: cookies-and-cream | ||
some-hard-coded-info: not-from-the-pipeline |
34 changes: 34 additions & 0 deletions
34
tests/kuttl/pipelines-driven-by-supply-chain/02-workload.yaml
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,34 @@ | ||
# Copyright 2021 VMware | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- | ||
apiVersion: carto.run/v1alpha1 | ||
kind: Workload | ||
metadata: | ||
name: petclinic | ||
labels: | ||
integration-test: "pipelines-driven-by-supply-chain" | ||
spec: | ||
params: | ||
- name: a-config-map | ||
value: | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: some-configmap | ||
data: | ||
an-ice-cream-flavor: cookies-and-cream | ||
source: | ||
git: | ||
url: https://github.com/spring-projects/spring-petclinic.git |