-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from nebari-dev/search_for_all_volumeMounts
add additional test data, check for volumeMounts anywhere in Workflow…
- Loading branch information
Showing
165 changed files
with
12,579 additions
and
45 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
A lot of the requess came from https://github.com/argoproj/argo-workflows/tree/master/examples. | ||
|
||
Then modified with convert_workflows.py. |
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,58 @@ | ||
from pathlib import Path | ||
|
||
import yaml | ||
|
||
preamble = """ | ||
apiVersion: admission.k8s.io/v1 | ||
kind: AdmissionReview | ||
request: | ||
dryRun: false | ||
kind: | ||
group: argoproj.io | ||
kind: Workflow | ||
version: v1alpha1 | ||
name: hello-world | ||
namespace: dev | ||
operation: CREATE | ||
options: | ||
apiVersion: meta.k8s.io/v1 | ||
kind: CreateOptions | ||
requestKind: | ||
group: argoproj.io | ||
kind: Workflow | ||
version: v1alpha1 | ||
requestResource: | ||
group: argoproj.io | ||
resource: workflows | ||
version: v1alpha1 | ||
resource: | ||
group: argoproj.io | ||
resource: workflows | ||
version: v1alpha1 | ||
uid: c1bba5c6-2189-41ff-9487-be504c04487b | ||
userInfo: | ||
groups: | ||
- system:serviceaccounts | ||
- system:serviceaccounts:dev | ||
- system:authenticated | ||
uid: eac0d7ab-af84-4c3f-a5fd-71845ff9e8c9 | ||
username: system:serviceaccount:dev:argo-admin | ||
""" | ||
|
||
new_request = yaml.load(preamble, Loader=yaml.FullLoader) | ||
files = Path("./requests/pass").glob("*.yaml") | ||
|
||
for request_file in files: | ||
with open(request_file, "r") as f: | ||
try: | ||
request = yaml.load(f, Loader=yaml.FullLoader) | ||
except Exception: | ||
print(str(request_file)) | ||
breakpoint() | ||
if request["kind"] == "Workflow": | ||
if value := request["metadata"].get("generateName"): | ||
request["metadata"]["name"] = value | ||
request["metadata"].pop("generateName") | ||
new_request["request"]["object"] = request | ||
with open(request_file, "w") as f: | ||
yaml.dump(new_request, f) |
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,74 @@ | ||
apiVersion: admission.k8s.io/v1 | ||
kind: AdmissionReview | ||
request: | ||
dryRun: false | ||
kind: | ||
group: argoproj.io | ||
kind: Workflow | ||
version: v1alpha1 | ||
name: hello-world | ||
namespace: dev | ||
object: | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
name: volumes-existing- | ||
spec: | ||
entrypoint: volumes-existing-example | ||
templates: | ||
- name: volumes-existing-example | ||
steps: | ||
- - name: generate | ||
template: append-to-accesslog | ||
- - name: print | ||
template: print-accesslog | ||
- container: | ||
args: | ||
- 'echo accessed at: $(date) | tee -a /mnt/vol/accesslog' | ||
command: | ||
- sh | ||
- -c | ||
image: alpine:latest | ||
volumeMounts: | ||
- mountPath: /mnt/vol | ||
name: workdir | ||
name: append-to-accesslog | ||
- container: | ||
args: | ||
- echo 'Volume access log:'; cat /mnt/vol/accesslog | ||
command: | ||
- sh | ||
- -c | ||
image: alpine:latest | ||
volumeMounts: | ||
- mountPath: /mnt/vol | ||
name: workdir | ||
name: print-accesslog | ||
volumes: | ||
- name: workdir | ||
persistentVolumeClaim: | ||
claimName: my-existing-volume | ||
operation: CREATE | ||
options: | ||
apiVersion: meta.k8s.io/v1 | ||
kind: CreateOptions | ||
requestKind: | ||
group: argoproj.io | ||
kind: Workflow | ||
version: v1alpha1 | ||
requestResource: | ||
group: argoproj.io | ||
resource: workflows | ||
version: v1alpha1 | ||
resource: | ||
group: argoproj.io | ||
resource: workflows | ||
version: v1alpha1 | ||
uid: c1bba5c6-2189-41ff-9487-be504c04487b | ||
userInfo: | ||
groups: | ||
- system:serviceaccounts | ||
- system:serviceaccounts:dev | ||
- system:authenticated | ||
uid: eac0d7ab-af84-4c3f-a5fd-71845ff9e8c9 | ||
username: system:serviceaccount:dev:argo-admin |
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,51 @@ | ||
apiVersion: admission.k8s.io/v1 | ||
kind: AdmissionReview | ||
request: | ||
dryRun: false | ||
kind: | ||
group: argoproj.io | ||
kind: Workflow | ||
version: v1alpha1 | ||
name: hello-world | ||
namespace: dev | ||
object: | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
name: archive-location- | ||
spec: | ||
entrypoint: whalesay | ||
templates: | ||
- archiveLocation: | ||
archiveLogs: true | ||
container: | ||
args: | ||
- hello world | ||
command: | ||
- cowsay | ||
image: docker/whalesay:latest | ||
name: whalesay | ||
operation: CREATE | ||
options: | ||
apiVersion: meta.k8s.io/v1 | ||
kind: CreateOptions | ||
requestKind: | ||
group: argoproj.io | ||
kind: Workflow | ||
version: v1alpha1 | ||
requestResource: | ||
group: argoproj.io | ||
resource: workflows | ||
version: v1alpha1 | ||
resource: | ||
group: argoproj.io | ||
resource: workflows | ||
version: v1alpha1 | ||
uid: c1bba5c6-2189-41ff-9487-be504c04487b | ||
userInfo: | ||
groups: | ||
- system:serviceaccounts | ||
- system:serviceaccounts:dev | ||
- system:authenticated | ||
uid: eac0d7ab-af84-4c3f-a5fd-71845ff9e8c9 | ||
username: system:serviceaccount:dev:argo-admin |
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,60 @@ | ||
apiVersion: admission.k8s.io/v1 | ||
kind: AdmissionReview | ||
request: | ||
dryRun: false | ||
kind: | ||
group: argoproj.io | ||
kind: Workflow | ||
version: v1alpha1 | ||
name: hello-world | ||
namespace: dev | ||
object: | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
name: arguments-artifacts- | ||
spec: | ||
arguments: | ||
artifacts: | ||
- http: | ||
url: https://storage.googleapis.com/kubernetes-release/release/v1.8.0/bin/linux/amd64/kubectl | ||
name: kubectl | ||
entrypoint: kubectl-input-artifact | ||
templates: | ||
- container: | ||
args: | ||
- kubectl version | ||
command: | ||
- sh | ||
- -c | ||
image: debian:9.4 | ||
inputs: | ||
artifacts: | ||
- mode: 493 | ||
name: kubectl | ||
path: /usr/local/bin/kubectl | ||
name: kubectl-input-artifact | ||
operation: CREATE | ||
options: | ||
apiVersion: meta.k8s.io/v1 | ||
kind: CreateOptions | ||
requestKind: | ||
group: argoproj.io | ||
kind: Workflow | ||
version: v1alpha1 | ||
requestResource: | ||
group: argoproj.io | ||
resource: workflows | ||
version: v1alpha1 | ||
resource: | ||
group: argoproj.io | ||
resource: workflows | ||
version: v1alpha1 | ||
uid: c1bba5c6-2189-41ff-9487-be504c04487b | ||
userInfo: | ||
groups: | ||
- system:serviceaccounts | ||
- system:serviceaccounts:dev | ||
- system:authenticated | ||
uid: eac0d7ab-af84-4c3f-a5fd-71845ff9e8c9 | ||
username: system:serviceaccount:dev:argo-admin |
Oops, something went wrong.