-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add additional resource template test (#5166)
Signed-off-by: Alex Collins <alex_collins@intuit.com>
- Loading branch information
Showing
6 changed files
with
83 additions
and
35 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
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 |
---|---|---|
@@ -1,30 +1,35 @@ | ||
# This example creates a Kubernetes resource that will be deleted | ||
# when the workflow is deleted via Kubernetes GC. | ||
# | ||
# A configmap is used for this example, but the same approach would apply | ||
# to other more interesting resource types. | ||
# | ||
# https://kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: k8s-owner-reference- | ||
labels: | ||
workflows.argoproj.io/test: "true" | ||
annotations: | ||
workflows.argoproj.io/description: | | ||
This example creates a Kubernetes resource that will be deleted | ||
when the workflow is deleted via Kubernetes GC. | ||
A workflow is used for this example, but the same approach would apply | ||
to other resource types. | ||
https://kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ | ||
workflows.argoproj.io/verify.py: | | ||
assert status["phase"] == "Succeeded" | ||
spec: | ||
entrypoint: k8s-owner-reference | ||
entrypoint: main | ||
templates: | ||
- name: k8s-owner-reference | ||
resource: | ||
action: create | ||
manifest: | | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
generateName: owned-eg- | ||
ownerReferences: | ||
- apiVersion: argoproj.io/v1alpha1 | ||
blockOwnerDeletion: true | ||
kind: Workflow | ||
name: "{{workflow.name}}" | ||
uid: "{{workflow.uid}}" | ||
data: | ||
some: value | ||
- name: main | ||
resource: | ||
action: create | ||
setOwnerReference: true | ||
manifest: | | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: owned-eg- | ||
spec: | ||
entrypoint: main | ||
templates: | ||
- name: main | ||
container: | ||
image: argoproj/argosay:v2 |
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,25 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: k8s-patch- | ||
labels: | ||
workflows.argoproj.io/test: "true" | ||
annotations: | ||
workflows.argoproj.io/description: | | ||
This example patches | ||
workflows.argoproj.io/verify.py: | | ||
assert status["phase"] == "Succeeded" | ||
spec: | ||
entrypoint: main | ||
templates: | ||
- name: main | ||
resource: | ||
action: patch | ||
mergeStrategy: json | ||
flags: | ||
- pod | ||
- "{{pod.name}}" | ||
manifest: | | ||
- op: add | ||
path: /metadata/annotations/foo | ||
value: bar |
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