File tree Expand file tree Collapse file tree 5 files changed +24
-41
lines changed Expand file tree Collapse file tree 5 files changed +24
-41
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,10 @@ YQ := yq
93
93
# Test variables
94
94
KIND_VERSION ?= 0.11.0
95
95
KUBERNETES_VERSION ?= 1.21.1
96
+ # Use a different kubectl version to pickup https://github.com/kubernetes/kubernetes/pull/96702 which resolves an issue
97
+ # with kubectl wait needed for integration testing. When KUBERNETES_VERSION is updated to >= 1.22.1 this can likely be
98
+ # removed.
99
+ KUBECTL_VERSION ?= 1.22.1
96
100
BATS_VERSION ?= 1.2.1
97
101
TRIVY_VERSION ?= 0.14.0
98
102
PROTOC_VERSION ?= 3.15.2
@@ -190,7 +194,7 @@ $(EKSCTL): ## Download and install eksctl
190
194
curl -sSLO https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_Linux_amd64.tar.gz && tar -zxvf eksctl_Linux_amd64.tar.gz && chmod +x eksctl && mv eksctl /usr/local/bin/
191
195
192
196
$(KUBECTL ) : # # Install kubectl
193
- curl -LO https://storage.googleapis.com/kubernetes-release/release/v$(KUBERNETES_VERSION ) /bin/linux/amd64/kubectl && chmod +x ./kubectl && mv kubectl /usr/local/bin/
197
+ curl -LO https://storage.googleapis.com/kubernetes-release/release/v$(KUBECTL_VERSION ) /bin/linux/amd64/kubectl && chmod +x ./kubectl && mv kubectl /usr/local/bin/
194
198
195
199
$(TRIVY ) : # # Install trivy for image vulnerability scan
196
200
trivy -v | grep -q $(TRIVY_VERSION ) || (curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v$( TRIVY_VERSION) )
Original file line number Diff line number Diff line change @@ -148,23 +148,17 @@ teardown_file() {
148
148
}
149
149
150
150
@test " CSI inline volume test with pod portability - unmount succeeds" {
151
- # https://github.com/kubernetes/kubernetes/pull/96702
152
- # kubectl wait --for=delete does not work on already deleted pods.
153
- # Instead we will start the wait before initiating the delete.
154
- kubectl wait --for=delete --timeout=${WAIT_TIME} s --namespace $NAMESPACE pod/$POD_NAME &
155
- WAIT_PID=$!
156
-
157
- sleep 1
151
+ # On Linux a failure to unmount the tmpfs will block the pod from being
152
+ # deleted.
158
153
run kubectl --namespace $NAMESPACE delete -f $BATS_TEST_DIR /BasicTestMount.yaml
159
154
assert_success
160
155
161
- # On Linux a failure to unmount the tmpfs will block the pod from being
162
- # deleted.
163
- run wait $WAIT_PID
156
+ run kubectl wait --for=delete --timeout=${WAIT_TIME} s --namespace $NAMESPACE pod/$POD_NAME
164
157
assert_success
165
158
166
159
# Sleep to allow time for logs to propagate.
167
160
sleep 10
161
+
168
162
# save debug information to archive in case of failure
169
163
archive_info
170
164
Original file line number Diff line number Diff line change @@ -126,22 +126,17 @@ setup() {
126
126
}
127
127
128
128
@test " CSI inline volume test with pod portability - unmount succeeds" {
129
- # https://github.com/kubernetes/kubernetes/pull/96702
130
- # kubectl wait --for=delete does not work on already deleted pods.
131
- # Instead we will start the wait before initiating the delete.
132
- kubectl wait --for=delete --timeout=${WAIT_TIME} s pod/secrets-store-inline-crd &
133
- WAIT_PID=$!
134
-
135
- sleep 1
136
- run kubectl delete pod secrets-store-inline-crd
137
-
138
129
# On Linux a failure to unmount the tmpfs will block the pod from being
139
130
# deleted.
140
- run wait $WAIT_PID
131
+ run kubectl delete pod secrets-store-inline-crd
132
+ assert_success
133
+
134
+ run kubectl wait --for=delete --timeout=${WAIT_TIME} s pod/secrets-store-inline-crd
141
135
assert_success
142
136
143
137
# Sleep to allow time for logs to propagate.
144
138
sleep 10
139
+
145
140
# save debug information to archive in case of failure
146
141
archive_info
147
142
Original file line number Diff line number Diff line change @@ -75,22 +75,17 @@ export SECRET_VALUE=${SECRET_VALUE:-"aHVudGVyMg=="}
75
75
}
76
76
77
77
@test " CSI inline volume test with pod portability - unmount succeeds" {
78
- # https://github.com/kubernetes/kubernetes/pull/96702
79
- # kubectl wait --for=delete does not work on already deleted pods.
80
- # Instead we will start the wait before initiating the delete.
81
- kubectl wait --for=delete --timeout=${WAIT_TIME} s --namespace=$NAMESPACE pod/secrets-store-inline-crd &
82
- WAIT_PID=$!
83
-
84
- sleep 1
85
- run kubectl delete pod secrets-store-inline-crd --namespace=$NAMESPACE
86
-
87
78
# On Linux a failure to unmount the tmpfs will block the pod from being
88
79
# deleted.
89
- run wait $WAIT_PID
80
+ run kubectl delete pod secrets-store-inline-crd --namespace=$NAMESPACE
81
+ assert_success
82
+
83
+ run kubectl wait --for=delete --timeout=${WAIT_TIME} s --namespace=$NAMESPACE pod/secrets-store-inline-crd
90
84
assert_success
91
85
92
86
# Sleep to allow time for logs to propagate.
93
87
sleep 10
88
+
94
89
# save debug information to archive in case of failure
95
90
archive_info
96
91
Original file line number Diff line number Diff line change @@ -114,22 +114,17 @@ EOF
114
114
}
115
115
116
116
@test " CSI inline volume test with pod portability - unmount succeeds" {
117
- # https://github.com/kubernetes/kubernetes/pull/96702
118
- # kubectl wait --for=delete does not work on already deleted pods.
119
- # Instead we will start the wait before initiating the delete.
120
- kubectl wait --for=delete --timeout=${WAIT_TIME} s pod/secrets-store-inline &
121
- WAIT_PID=$!
122
-
123
- sleep 1
124
- run kubectl delete pod secrets-store-inline
125
-
126
117
# On Linux a failure to unmount the tmpfs will block the pod from being
127
118
# deleted.
128
- run wait $WAIT_PID
119
+ run kubectl delete pod secrets-store-inline
120
+ assert_success
121
+
122
+ run kubectl wait --for=delete --timeout=${WAIT_TIME} s pod/secrets-store-inline
129
123
assert_success
130
124
131
125
# Sleep to allow time for logs to propagate.
132
126
sleep 10
127
+
133
128
# save debug information to archive in case of failure
134
129
archive_info
135
130
You can’t perform that action at this time.
0 commit comments