Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 5948726

Browse files
authored
Merge pull request #19 from jumpstarter-dev/provisioning
Test client object provisioning
2 parents 4671491 + 5a942b1 commit 5948726

File tree

3 files changed

+30
-16
lines changed

3 files changed

+30
-16
lines changed

dex.values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ config:
2222
hash: "$2a$10$2b2cU8CPhOTaGrs1HRQuAueS7JTT5ZHsHSzYiFPm1leZck7Mc8T4W" # password
2323
username: "test-client-oidc"
2424
userID: "73bca0b9-9be6-4e73-a8fb-347c2ac23255"
25+
- email: "test-client-oidc-provisioning@example.com"
26+
hash: "$2a$10$2b2cU8CPhOTaGrs1HRQuAueS7JTT5ZHsHSzYiFPm1leZck7Mc8T4W" # password
27+
username: "test-client-oidc-provisioning"
28+
userID: "464d9494-5cc3-44e1-a380-c0403bd31fcb"
2529
- email: "test-exporter-oidc@example.com"
2630
hash: "$2a$10$2b2cU8CPhOTaGrs1HRQuAueS7JTT5ZHsHSzYiFPm1leZck7Mc8T4W" # password
2731
username: "test-exporter-oidc"

tests.bats

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
setup() {
22
bats_load_library bats-support
33
bats_load_library bats-assert
4+
5+
bats_require_minimum_version 1.5.0
6+
}
7+
8+
wait_for_exporter() {
9+
kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \
10+
exporters.jumpstarter.dev/test-exporter-oidc
11+
kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \
12+
exporters.jumpstarter.dev/test-exporter-sa
13+
kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \
14+
exporters.jumpstarter.dev/test-exporter-legacy
415
}
516

617
@test "can create clients with admin cli" {
@@ -31,6 +42,11 @@ setup() {
3142
--issuer https://dex.dex.svc.cluster.local:5556 \
3243
--username test-client-oidc@example.com --password password --unsafe
3344

45+
jmp login --client test-client-oidc-provisioning \
46+
--endpoint "$ENDPOINT" --namespace default --name "" \
47+
--issuer https://dex.dex.svc.cluster.local:5556 \
48+
--username test-client-oidc-provisioning@example.com --password password --unsafe
49+
3450
jmp login --client test-client-sa \
3551
--endpoint "$ENDPOINT" --namespace default --name test-client-sa \
3652
--issuer https://dex.dex.svc.cluster.local:5556 \
@@ -78,17 +94,12 @@ while true; do
7894
done
7995
EOF
8096

81-
kubectl -n default wait --for=condition=Online --for=condition=Registered \
82-
exporters.jumpstarter.dev/test-exporter-oidc
83-
kubectl -n default wait --for=condition=Online --for=condition=Registered \
84-
exporters.jumpstarter.dev/test-exporter-sa
85-
kubectl -n default wait --for=condition=Online --for=condition=Registered \
86-
exporters.jumpstarter.dev/test-exporter-legacy
97+
98+
wait_for_exporter
8799
}
88100

89101
@test "can specify client config only using environment variables" {
90-
kubectl -n default wait --for=condition=Online --for=condition=Registered \
91-
exporters.jumpstarter.dev/test-exporter-oidc
102+
wait_for_exporter
92103

93104
JMP_NAMEPSACE=default \
94105
JMP_NAME=test-exporter-legacy \
@@ -98,8 +109,7 @@ EOF
98109
}
99110

100111
@test "can operate on leases" {
101-
kubectl -n default wait --for=condition=Online --for=condition=Registered \
102-
exporters.jumpstarter.dev/test-exporter-oidc
112+
wait_for_exporter
103113

104114
jmp config client use test-client-oidc
105115

@@ -110,16 +120,14 @@ EOF
110120
}
111121

112122
@test "can lease and connect to exporters" {
113-
kubectl -n default wait --for=condition=Online --for=condition=Registered \
114-
exporters.jumpstarter.dev/test-exporter-oidc
115-
kubectl -n default wait --for=condition=Online --for=condition=Registered \
116-
exporters.jumpstarter.dev/test-exporter-sa
117-
kubectl -n default wait --for=condition=Online --for=condition=Registered \
118-
exporters.jumpstarter.dev/test-exporter-legacy
123+
wait_for_exporter
119124

120125
jmp shell --client test-client-oidc --selector example.com/board=oidc j power on
121126
jmp shell --client test-client-sa --selector example.com/board=sa j power on
122127
jmp shell --client test-client-legacy --selector example.com/board=legacy j power on
128+
129+
wait_for_exporter
130+
jmp shell --client test-client-oidc-provisioning --selector example.com/board=oidc j power on
123131
}
124132

125133
@test "can get crds with admin cli" {

values.kind.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ jumpstarter-controller:
77
grpc:
88
mode: "ingress"
99
config:
10+
provisioning:
11+
enabled: true
1012
authentication:
1113
jwt:
1214
- issuer:

0 commit comments

Comments
 (0)