Skip to content

Commit

Permalink
Merge pull request #733 from andyzhangx/fix-e2e-test
Browse files Browse the repository at this point in the history
test: add default namespace in examples to fix e2e test failure
  • Loading branch information
andyzhangx authored Aug 9, 2024
2 parents 2524d92 + e79a19d commit 59364a0
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ endif
.PHONY: install-nfs-server
install-nfs-server:
kubectl apply -f ./deploy/example/nfs-provisioner/nfs-server.yaml
kubectl delete secret mount-options --ignore-not-found
kubectl create secret generic mount-options --from-literal mountOptions="nfsvers=4.1"
kubectl delete secret mount-options -n default --ignore-not-found
kubectl create secret generic mount-options --from-literal mountOptions="nfsvers=4.1" -n default

.PHONY: install-helm
install-helm:
Expand Down
1 change: 1 addition & 0 deletions deploy/example/cloning/nginx-pod-restored-cloning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: Pod
apiVersion: v1
metadata:
name: nginx-nfs-restored-cloning
namespace: default
spec:
nodeSelector:
"kubernetes.io/os": linux
Expand Down
1 change: 1 addition & 0 deletions deploy/example/daemonset-nfs-ephemeral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: DaemonSet
apiVersion: apps/v1
metadata:
name: daemonset-nfs-ephemeral
namespace: default
spec:
selector:
matchLabels:
Expand Down
2 changes: 2 additions & 0 deletions deploy/example/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-deployment-nfs
namespace: default
spec:
accessModes:
- ReadWriteMany # In this example, multiple Pods consume the same PVC.
Expand All @@ -15,6 +16,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: deployment-nfs
namespace: default
spec:
replicas: 1
selector:
Expand Down
2 changes: 2 additions & 0 deletions deploy/example/nfs-provisioner/nfs-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: Service
apiVersion: v1
metadata:
name: nfs-server
namespace: default
labels:
app: nfs-server
spec:
Expand All @@ -21,6 +22,7 @@ kind: Deployment
apiVersion: apps/v1
metadata:
name: nfs-server
namespace: default
spec:
replicas: 1
selector:
Expand Down
3 changes: 3 additions & 0 deletions deploy/example/nfs-provisioner/nginx-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
annotations:
pv.kubernetes.io/provisioned-by: nfs.csi.k8s.io
name: pv-nginx
namespace: default
spec:
capacity:
storage: 10Gi
Expand All @@ -26,6 +27,7 @@ kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc-nginx
namespace: default
spec:
accessModes:
- ReadWriteOnce
Expand All @@ -39,6 +41,7 @@ apiVersion: v1
kind: Pod
metadata:
name: nginx-nfs-example
namespace: default
spec:
containers:
- image: nginx
Expand Down
1 change: 1 addition & 0 deletions deploy/example/nginx-pod-inline-volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: Pod
apiVersion: v1
metadata:
name: nginx-pod-inline-volume
namespace: default
spec:
nodeSelector:
"kubernetes.io/os": linux
Expand Down
1 change: 1 addition & 0 deletions deploy/example/nginx-pod-nfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: Pod
apiVersion: v1
metadata:
name: nginx-nfs
namespace: default
spec:
nodeSelector:
"kubernetes.io/os": linux
Expand Down
1 change: 1 addition & 0 deletions deploy/example/pvc-nfs-csi-dynamic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-nfs-dynamic
namespace: default
spec:
accessModes:
- ReadWriteMany
Expand Down
1 change: 1 addition & 0 deletions deploy/example/pvc-nfs-csi-static.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc-nfs-static
namespace: default
spec:
accessModes:
- ReadWriteMany
Expand Down
1 change: 1 addition & 0 deletions deploy/example/snapshot/nginx-pod-restored-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: Pod
apiVersion: v1
metadata:
name: nginx-nfs-restored-snapshot
namespace: default
spec:
nodeSelector:
"kubernetes.io/os": linux
Expand Down
1 change: 1 addition & 0 deletions deploy/example/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: apps/v1
kind: StatefulSet
metadata:
name: statefulset-nfs
namespace: default
labels:
app: nginx
spec:
Expand Down
4 changes: 2 additions & 2 deletions hack/verify-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ rollout_and_wait() {

APPNAME=$(kubectl apply -f $1 | grep -E "^(:?daemonset|deployment|statefulset|pod)" | awk '{printf $1}')
if [[ -n $(expr "${APPNAME}" : "\(daemonset\|deployment\|statefulset\|pod\)" || true) ]]; then
kubectl rollout status $APPNAME --watch --timeout=5m
kubectl rollout status $APPNAME --watch --timeout=5m -n default
else
kubectl wait "${APPNAME}" --for condition=ready --timeout=5m
kubectl wait "${APPNAME}" --for condition=ready --timeout=5m -n default
fi
}

Expand Down

0 comments on commit 59364a0

Please sign in to comment.