Skip to content

Commit 33b729b

Browse files
committed
test: migrate workload-derives-deployment from infra
Migrate the Workload-derives-WorkloadDeployment contract test out of datum-cloud/infra into the owning repo, per datum-cloud/infra#3006. That issue consolidates infra's live-env Chainsaw suite into one "construct" group and evacuates single-service compute.datumapis.com contract tests to compute, run against the local kind harness pre-merge. This test applies a Workload and asserts the control plane accepts it, then waits for the derived WorkloadDeployment (<name>-central) to reach Progressing=true and asserts it — control-plane derivation only, no wait for VMs to become Available. Key changes: - Add test/e2e/workload-derives-deployment/ with the chainsaw test and the location.yaml / network.yaml / workload.yaml fixtures copied from infra. - Drop the datumctl auth update-kubeconfig setup step and the project control-plane cluster block; target a local kind cluster via spec.cluster, mirroring datum-cloud/network-services-operator. - Remove spec.skip: true. Depends on the chainsaw harness introduced in the workload-api-acceptance migration PR (Makefile kind + chainsaw tooling and the test-chainsaw target).
1 parent 7f880e5 commit 33b729b

4 files changed

Lines changed: 97 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
2+
apiVersion: chainsaw.kyverno.io/v1alpha1
3+
kind: Test
4+
metadata:
5+
name: workload-derives-deployment
6+
spec:
7+
cluster: compute-e2e
8+
steps:
9+
- name: Apply Workload and fixtures
10+
try:
11+
- apply:
12+
timeout: 1m
13+
file: location.yaml
14+
- apply:
15+
timeout: 1m
16+
file: network.yaml
17+
- apply:
18+
timeout: 1m
19+
file: workload.yaml
20+
- assert:
21+
resource:
22+
apiVersion: compute.datumapis.com/v1alpha
23+
kind: Workload
24+
metadata:
25+
name: e2e-derived-workload
26+
27+
- name: Assert WorkloadDeployment is derived per placement
28+
try:
29+
- wait:
30+
apiVersion: compute.datumapis.com/v1alpha
31+
kind: WorkloadDeployment
32+
name: e2e-derived-workload-central
33+
timeout: 3m
34+
for:
35+
condition:
36+
name: Progressing
37+
value: 'true'
38+
- assert:
39+
resource:
40+
apiVersion: compute.datumapis.com/v1alpha
41+
kind: WorkloadDeployment
42+
metadata:
43+
name: e2e-derived-workload-central
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: networking.datumapis.com/v1alpha
2+
kind: Location
3+
metadata:
4+
name: us-central1-a
5+
labels:
6+
topology.datum.net/city-code: ORD
7+
spec:
8+
provider:
9+
gcp:
10+
projectId: datum-cloud-staging
11+
region: us-central1
12+
zone: us-central1-a
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: networking.datumapis.com/v1alpha
2+
kind: Network
3+
metadata:
4+
name: e2e-derived-network
5+
namespace: default
6+
spec:
7+
ipam:
8+
mode: Auto
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apiVersion: compute.datumapis.com/v1alpha
2+
kind: Workload
3+
metadata:
4+
name: e2e-derived-workload
5+
namespace: default
6+
spec:
7+
template:
8+
spec:
9+
runtime:
10+
resources:
11+
instanceType: datumcloud/d1-standard-2
12+
sandbox:
13+
containers:
14+
- name: httpbin
15+
image: kennethreitz/httpbin
16+
ports:
17+
- name: http
18+
port: 80
19+
networkInterfaces:
20+
- network:
21+
name: e2e-derived-network
22+
networkPolicy:
23+
ingress:
24+
- ports:
25+
- port: 80
26+
from:
27+
- ipBlock:
28+
cidr: 0.0.0.0/0
29+
placements:
30+
- name: central
31+
cityCodes:
32+
- ORD
33+
scaleSettings:
34+
minReplicas: 1

0 commit comments

Comments
 (0)