|
1 | 1 | config: |
2 | 2 | env: |
3 | 3 | CL_CONFIG_FILE: openrun.toml |
| 4 | + # commander replaces the process environment with this map; OPENRUN_HOME |
| 5 | + # anchors the CLI's socket/config resolution to the tests dir, and |
| 6 | + # PATH/HOME are needed for kubectl (binary lookup + kubeconfig) |
| 7 | + OPENRUN_HOME: . |
| 8 | + PATH: ${PATH} |
| 9 | + HOME: ${HOME} |
4 | 10 | HTTP_PORT: ${HTTP_PORT} |
5 | 11 | GOCOVERDIR: ${GOCOVERDIR}/../client |
| 12 | + KUBE_BINDING_IMAGE: ${KUBE_BINDING_IMAGE} |
| 13 | + KUBE_TEST_NAMESPACE: ${KUBE_TEST_NAMESPACE} |
6 | 14 | tests: |
7 | 15 | kubernetes010: # setup flask app |
8 | 16 | command: rm -rf ./flaskapp && mkdir flaskapp && cp flask.py flaskapp/app.py |
@@ -127,3 +135,67 @@ tests: |
127 | 135 | kubernetes823: # health endpoint still serves the old, working version |
128 | 136 | command: curl -sS localhost:${HTTP_PORT}/kube_verify |
129 | 137 | stdout: "ok" |
| 138 | + |
| 139 | + # Out-of-process binding providers, OCI distribution path: the harness built |
| 140 | + # the fixture provider into bindings.preinstalled_dir (as the Helm chart's |
| 141 | + # init containers populate the shared volume) and pushed it as a FROM |
| 142 | + # scratch image to the test registry. |
| 143 | + kubernetes900: # preinstalled provider is registered: its service type works |
| 144 | + command: ../openrun service create --config url=fixture://kube fixture/kfx1 |
| 145 | + stdout: "Service fixture/kfx1 created" |
| 146 | + kubernetes901: # binding create goes through the preinstalled provider |
| 147 | + command: ../openrun binding create fixture/kfx1 /kube_fx1 |
| 148 | + stdout: "Binding /kube_fx1 created" |
| 149 | + kubernetes902: # run-command round trip through the provider process |
| 150 | + command: ../openrun binding run-command /kube_fx1 "echo:oci-ok" | jq -r '.echo' |
| 151 | + stdout: "oci-ok" |
| 152 | + kubernetes903: # disable_install rejects imperative provider install |
| 153 | + command: ../openrun provider install fixture --version v0.1.0 |
| 154 | + stderr: "provider install is disabled" |
| 155 | + exit-code: 1 |
| 156 | + kubernetes904: # disable_install rejects imperative provider uninstall |
| 157 | + command: ../openrun provider uninstall fixture |
| 158 | + stderr: "provider uninstall is disabled" |
| 159 | + exit-code: 1 |
| 160 | + kubernetes910: # in-cluster export: init container copies the provider out of the scratch image |
| 161 | + command: | |
| 162 | + kubectl apply -n ${KUBE_TEST_NAMESPACE} -f - <<EOF |
| 163 | + apiVersion: v1 |
| 164 | + kind: Pod |
| 165 | + metadata: |
| 166 | + name: binding-export-test |
| 167 | + spec: |
| 168 | + restartPolicy: Never |
| 169 | + initContainers: |
| 170 | + - name: binding-provider-fixture |
| 171 | + image: ${KUBE_BINDING_IMAGE} |
| 172 | + command: ["/openrun-binding-fixture", "export", "/providers"] |
| 173 | + volumeMounts: |
| 174 | + - name: providers |
| 175 | + mountPath: /providers |
| 176 | + containers: |
| 177 | + - name: check |
| 178 | + image: busybox:1.36 |
| 179 | + command: ["sh", "-c", "test -x /providers/openrun-binding-fixture && echo EXPORT_OK"] |
| 180 | + volumeMounts: |
| 181 | + - name: providers |
| 182 | + mountPath: /providers |
| 183 | + volumes: |
| 184 | + - name: providers |
| 185 | + emptyDir: {} |
| 186 | + EOF |
| 187 | + stdout: "pod/binding-export-test created" |
| 188 | + kubernetes911: # exported binary is present and executable in the shared volume |
| 189 | + command: kubectl wait -n ${KUBE_TEST_NAMESPACE} --for=jsonpath='{.status.phase}'=Succeeded pod/binding-export-test --timeout=120s && kubectl logs -n ${KUBE_TEST_NAMESPACE} binding-export-test -c check |
| 190 | + stdout: "EXPORT_OK" |
| 191 | + kubernetes912: # init container logged the export |
| 192 | + command: kubectl logs -n ${KUBE_TEST_NAMESPACE} binding-export-test -c binding-provider-fixture |
| 193 | + stdout: "exported /providers/openrun-binding-fixture" |
| 194 | + kubernetes913: # cleanup export test pod |
| 195 | + command: kubectl delete pod binding-export-test -n ${KUBE_TEST_NAMESPACE} --ignore-not-found |
| 196 | + kubernetes920: # binding delete through the provider |
| 197 | + command: ../openrun binding delete /kube_fx1 |
| 198 | + stdout: "Binding /kube_fx1 deleted" |
| 199 | + kubernetes921: # service delete |
| 200 | + command: ../openrun service delete fixture/kfx1 |
| 201 | + stdout: "Service fixture/kfx1 deleted" |
0 commit comments