From 38438cde1f83fd781a325819cfc137e7d4cc812d Mon Sep 17 00:00:00 2001 From: jiaxiao zhou Date: Tue, 14 Nov 2023 01:05:02 +0000 Subject: [PATCH] test(spin): moved runtime-config file to ConfigMap Signed-off-by: jiaxiao zhou --- images/spin-keyvalue/Dockerfile | 1 - tests/workloads/spin-runtime-config.yaml | 11 +++++++++++ tests/workloads/workload.yaml | 9 +++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 tests/workloads/spin-runtime-config.yaml diff --git a/images/spin-keyvalue/Dockerfile b/images/spin-keyvalue/Dockerfile index 30295ef..cf4724b 100644 --- a/images/spin-keyvalue/Dockerfile +++ b/images/spin-keyvalue/Dockerfile @@ -6,4 +6,3 @@ RUN rustup target add wasm32-wasi && cargo build --target wasm32-wasi --release FROM scratch COPY --from=build /opt/build/spin.toml ./spin.toml COPY --from=build /opt/build/target/wasm32-wasi/release/spin_keyvalue.wasm ./target/wasm32-wasi/release/spin_keyvalue.wasm -COPY --from=build /opt/build/runtime-config.toml ./runtime-config.toml \ No newline at end of file diff --git a/tests/workloads/spin-runtime-config.yaml b/tests/workloads/spin-runtime-config.yaml new file mode 100644 index 0000000..9d2557c --- /dev/null +++ b/tests/workloads/spin-runtime-config.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +data: + runtime-config.toml: "# This defines a new store named user_data\n[key_value_store.foo]\ntype + = \"spin\" \npath = \"user_data.db\"" +kind: ConfigMap +metadata: + creationTimestamp: "2023-11-14T00:41:01Z" + name: spin-runtime-config + namespace: default + resourceVersion: "4453" + uid: 10dd6b0d-cf71-4ddc-abf8-44853f53436e \ No newline at end of file diff --git a/tests/workloads/workload.yaml b/tests/workloads/workload.yaml index a46f8fc..eab489e 100644 --- a/tests/workloads/workload.yaml +++ b/tests/workloads/workload.yaml @@ -98,6 +98,15 @@ spec: image: docker.io/library/spin-keyvalue:latest command: ["/"] imagePullPolicy: IfNotPresent + volumeMounts: + - name: config-volume + mountPath: /runtime-config.toml + subPath: runtime-config.toml + readOnly: true + volumes: + - name: config-volume + configMap: + name: spin-runtime-config --- apiVersion: v1 kind: Service