Skip to content

Commit

Permalink
test(v2): secret as volume
Browse files Browse the repository at this point in the history
Add test case to use a secret as a volume.

Signed-off-by: Yihong Wang <[email protected]>
  • Loading branch information
yhwang committed Jul 27, 2023
1 parent 1a818dd commit f036a2b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,7 @@ jobs:
run: |
. .venv/bin/activate
TEST_SCRIPT="test-secret-as-env.sh" ./scripts/deploy/github/e2e-test.sh
- name: "secret as volume"
run: |
. .venv/bin/activate
TEST_SCRIPT="test-secret-as-volume.sh" ./scripts/deploy/github/e2e-test.sh
39 changes: 39 additions & 0 deletions scripts/deploy/github/test-secret-as-volume.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
#
# Copyright 2023 kubeflow.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

KUBEFLOW_NS="${KUBEFLOW_NS:-kubeflow}"

C_DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$C_DIR" ]]; then C_DIR="$PWD"; fi
source "${C_DIR}/test-pipeline.sh"

# need kfp-kubernetes for this test case
# unfortunately, we can't install it from kubernetes_platform/python
pip install kfp-kubernetes

# create the secret
kubectl create secret -n "$KUBEFLOW_NS" generic "user-gcp-sa" --from-literal="type=service_account" || true

RESULT=0
run_test_case "secret-volume" "samples/v2/pipeline_with_secret_as_volume.py" "SUCCEEDED" 5 || RESULT=$?

# remove secret after the test finishes
kubectl delete secret -n "$KUBEFLOW_NS" "user-gcp-sa"

STATUS_MSG=PASSED
if [[ "$RESULT" -ne 0 ]]; then
STATUS_MSG=FAILED
fi

0 comments on commit f036a2b

Please sign in to comment.