Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a PV, a PVC and a volume to the test pods #420

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ install:
./scripts/fix-node-labels.sh
./scripts/deploy-multus-network.sh
./scripts/deploy-resource-quota.sh
./scripts/deploy-storage.sh
./scripts/deploy-test-pods.sh
./scripts/deploy-statefulset-test-pods.sh
./scripts/deploy-pod-disruption-budget.sh
Expand Down
1 change: 1 addition & 0 deletions scripts/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ source "$SCRIPT_DIR"/init-env.sh
./"$SCRIPT_DIR"/delete-resource-quota.sh
./"$SCRIPT_DIR"/delete-pod-disruption-budget.sh
./"$SCRIPT_DIR"/delete-cr-scale-operator.sh
./"$SCRIPT_DIR"/delete-storage.sh
14 changes: 14 additions & 0 deletions scripts/delete-storage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# Initialization
SCRIPT_DIR=$(dirname "$0")

# shellcheck disable=SC1091 # Not following.
source "$SCRIPT_DIR"/init-env.sh

mkdir -p ./temp

# shellcheck disable=SC2002 # Useless cat.
cat ./test-target/storage.yaml | "$SCRIPT_DIR"/mo >./temp/rendered-test-storage.yaml
rdavid marked this conversation as resolved.
Show resolved Hide resolved
oc delete --filename ./temp/rendered-test-storage.yaml -n "$TNF_EXAMPLE_CNF_NAMESPACE" --ignore-not-found=true
rm ./temp/rendered-test-storage.yaml
14 changes: 14 additions & 0 deletions scripts/deploy-storage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# Initialization
SCRIPT_DIR=$(dirname "$0")

# shellcheck disable=SC1091 # Not following.
source "$SCRIPT_DIR"/init-env.sh

mkdir -p ./temp

# shellcheck disable=SC2002 # Useless cat.
cat ./test-target/storage.yaml | "$SCRIPT_DIR"/mo >./temp/rendered-test-storage.yaml
oc apply --filename ./temp/rendered-test-storage.yaml --namespace "$TNF_EXAMPLE_CNF_NAMESPACE"
rm ./temp/rendered-test-storage.yaml
4 changes: 4 additions & 0 deletions test-target/local-pod-under-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ spec:
periodSeconds: 5
command: ["./bin/app"]
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- name: test-volume
persistentVolumeClaim:
claimName: test-pvc
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
30 changes: 30 additions & 0 deletions test-target/storage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: test-pv
labels:
role: test
spec:
capacity:
storage: 10Mi
accessModes:
- ReadWriteOnce
hostPath:
path: /data
persistentVolumeReclaimPolicy: Delete
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: test-pvc
namespace: {{ TNF_EXAMPLE_CNF_NAMESPACE }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Mi
selector:
matchLabels:
role: test

Loading