-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
justfile
104 lines (88 loc) · 4.4 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
[private]
default:
@just --list --unsorted
fmt:
cargo +nightly fmt
lint:
cargo clippy
test: test-pr test-sm test-mv test-argo test-agent test-certmanager test-cluster test-gateway-route test-linkerd-serverauth test-linkerd-server
test-pr:
kubectl apply --force-conflicts --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.52.0/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml
cargo run --bin kopium -- prometheusrules.monitoring.coreos.com > tests/gen.rs
echo "pub type CR = PrometheusRule;" >> tests/gen.rs
kubectl apply -f tests/pr.yaml
cargo test --test runner -- --nocapture
test-sm:
kubectl apply --force-conflicts --server-side -f tests/servicemon-crd.yaml
cargo run --bin kopium -- -df tests/servicemon-crd.yaml > tests/gen.rs
echo "pub type CR = ServiceMonitor;" >> tests/gen.rs
kubectl apply -f tests/servicemon.yaml
cargo test --test runner -- --nocapture
test-mv:
kubectl apply -f tests/mv-crd.yaml
cargo run --bin kopium -- multiversions.clux.dev -A > tests/gen.rs
echo "pub type CR = MultiVersion;" >> tests/gen.rs
kubectl apply -f tests/mv.yaml
cargo test --test runner -- --nocapture
test-agent:
kubectl apply -f tests/agent-crd.yaml
cargo run --bin kopium -- -bAf tests/agent-crd.yaml > tests/gen.rs
echo "pub type CR = Agent;" >> tests/gen.rs
kubectl apply -f tests/agent.yaml
cargo test --test runner -- --nocapture
test-argo:
kubectl apply --force-conflicts --server-side -f https://raw.githubusercontent.com/argoproj/argo-cd/master/manifests/crds/application-crd.yaml
cargo run --bin kopium -- applications.argoproj.io > tests/gen.rs
echo "pub type CR = Application;" >> tests/gen.rs
kubectl apply -f tests/app.yaml
cargo test --test runner -- --nocapture
test-argo-wf:
# argo workflows are hard to test since the full crd are not supposed to be installed in k8s
! cargo run --bin kopium -- --filename tests/argoproj.io_clusterworkflowtemplates.yaml > /dev/null
cargo run --bin kopium -- --relaxed --filename tests/argoproj.io_clusterworkflowtemplates.yaml > /dev/null
test-certmanager:
kubectl apply --force-conflicts --server-side -f https://github.com/jetstack/cert-manager/releases/download/v1.7.1/cert-manager.crds.yaml
cargo run --bin kopium -- -d certificates.cert-manager.io > tests/gen.rs
echo "pub type CR = Certificate;" >> tests/gen.rs
kubectl apply -f tests/cert.yaml
cargo test --test runner -- --nocapture
test-cluster:
kubectl apply -f tests/cluster-crd.yaml
cargo run --bin kopium -- -f tests/cluster-crd.yaml -d > tests/gen.rs
echo "pub type CR = Cluster;" >> tests/gen.rs
# No test instance for this crd
cargo build --test runner
test-gateway-route:
kubectl apply --server-side -f tests/httproute-crd.yaml
cargo run --bin kopium -- -f tests/httproute-crd.yaml > tests/gen.rs
echo "pub type CR = HTTPRoute;" >> tests/gen.rs
kubectl apply -f tests/httproute.yaml
cargo test --test runner -- --nocapture
test-linkerd-serverauth:
kubectl apply --server-side -f tests/serverauth-crd.yaml
cargo run --bin kopium -- -d serverauthorizations.policy.linkerd.io > tests/gen.rs
echo "pub type CR = ServerAuthorization;" >> tests/gen.rs
kubectl apply -f tests/serverauth.yaml
cargo test --test runner -- --nocapture
test-linkerd-server:
#kubectl apply --server-side -f tests/server-crd.yaml
#cargo run --bin kopium -- -b servers.policy.linkerd.io > tests/gen.rs
#echo "pub type CR = Server;" >> tests/gen.rs
#kubectl apply -f tests/server.yaml
#cargo test --test runner -- --nocapture
test-istio-destrule:
kubectl apply --server-side -f tests/destinationrule-crd.yaml
cargo run --bin kopium -- destinationrules.networking.istio.io > tests/gen.rs
echo "pub type CR = DestinationRule;" >> tests/gen.rs
kubectl apply -f tests/destinationrule.yaml
# NB: this currently fails because of an empty status object with preserve-unknown-fields
cargo test --test runner -- --nocapture
test-podmon:
kubectl apply --server-side -f tests/podmon-crd.yaml
#curl -sSL https://github.com/prometheus-operator/prometheus-operator/raw/main/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml > tests/podmon-crd.yaml
cargo run --bin kopium -- podmonitors.monitoring.coreos.com > tests/gen.rs
echo "pub type CR = PodMonitor;" >> tests/gen.rs
kubectl apply -f tests/podmon.yaml
cargo test --test runner -- --nocapture
release:
cargo release minor --execute