Skip to content
Draft
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
43 changes: 43 additions & 0 deletions test/e2e/workload-derives-deployment/chainsaw-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: workload-derives-deployment
spec:
cluster: compute-e2e
steps:
- name: Apply Workload and fixtures
try:
- apply:
timeout: 1m
file: location.yaml
- apply:
timeout: 1m
file: network.yaml
- apply:
timeout: 1m
file: workload.yaml
- assert:
resource:
apiVersion: compute.datumapis.com/v1alpha
kind: Workload
metadata:
name: e2e-derived-workload

- name: Assert WorkloadDeployment is derived per placement
try:
- wait:
apiVersion: compute.datumapis.com/v1alpha
kind: WorkloadDeployment
name: e2e-derived-workload-central
timeout: 3m
for:
condition:
name: Progressing
value: 'true'
- assert:
resource:
apiVersion: compute.datumapis.com/v1alpha
kind: WorkloadDeployment
metadata:
name: e2e-derived-workload-central
12 changes: 12 additions & 0 deletions test/e2e/workload-derives-deployment/location.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: networking.datumapis.com/v1alpha
kind: Location
metadata:
name: us-central1-a
labels:
topology.datum.net/city-code: ORD
spec:
provider:
gcp:
projectId: datum-cloud-staging
region: us-central1
zone: us-central1-a
8 changes: 8 additions & 0 deletions test/e2e/workload-derives-deployment/network.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: networking.datumapis.com/v1alpha
kind: Network
metadata:
name: e2e-derived-network
namespace: default
spec:
ipam:
mode: Auto
34 changes: 34 additions & 0 deletions test/e2e/workload-derives-deployment/workload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: compute.datumapis.com/v1alpha
kind: Workload
metadata:
name: e2e-derived-workload
namespace: default
spec:
template:
spec:
runtime:
resources:
instanceType: datumcloud/d1-standard-2
sandbox:
containers:
- name: httpbin
image: kennethreitz/httpbin
ports:
- name: http
port: 80
networkInterfaces:
- network:
name: e2e-derived-network
networkPolicy:
ingress:
- ports:
- port: 80
from:
- ipBlock:
cidr: 0.0.0.0/0
placements:
- name: central
cityCodes:
- ORD
scaleSettings:
minReplicas: 1
Loading