Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
b5405392
Unverified
Commit
b5405392
authored
Apr 19, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Apr 19, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #76810 from SataQiu/fix-hack-shellcheck-2019041903
Fix shellcheck failures of hack/test-update-storage-objects.sh
parents
f3ec8f0d
4d6319b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
.shellcheck_failures
hack/.shellcheck_failures
+0
-1
test-update-storage-objects.sh
hack/test-update-storage-objects.sh
+10
-10
No files found.
hack/.shellcheck_failures
View file @
b5405392
...
@@ -41,7 +41,6 @@
...
@@ -41,7 +41,6 @@
./hack/make-rules/vet.sh
./hack/make-rules/vet.sh
./hack/pin-dependency.sh
./hack/pin-dependency.sh
./hack/test-integration.sh
./hack/test-integration.sh
./hack/test-update-storage-objects.sh
./hack/update-vendor.sh
./hack/update-vendor.sh
./hack/verify-api-groups.sh
./hack/verify-api-groups.sh
./hack/verify-boilerplate.sh
./hack/verify-boilerplate.sh
...
...
hack/test-update-storage-objects.sh
View file @
b5405392
...
@@ -20,7 +20,7 @@ set -o errexit
...
@@ -20,7 +20,7 @@ set -o errexit
set
-o
nounset
set
-o
nounset
set
-o
pipefail
set
-o
pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
/..
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
# The api version in which objects are currently stored in etcd.
# The api version in which objects are currently stored in etcd.
...
@@ -67,7 +67,7 @@ function startApiServer() {
...
@@ -67,7 +67,7 @@ function startApiServer() {
--cert-dir
=
"
${
TMPDIR
:-
/tmp/
}
"
\
--cert-dir
=
"
${
TMPDIR
:-
/tmp/
}
"
\
--service-cluster-ip-range
=
"10.0.0.0/24"
\
--service-cluster-ip-range
=
"10.0.0.0/24"
\
--storage-versions
=
"
${
storage_versions
}
"
\
--storage-versions
=
"
${
storage_versions
}
"
\
--storage-media-type
=
${
storage_media_type
}
1>&2 &
--storage-media-type
=
"
${
storage_media_type
}
"
1>&2 &
APISERVER_PID
=
$!
APISERVER_PID
=
$!
# url, prefix, wait, times
# url, prefix, wait, times
...
@@ -103,7 +103,7 @@ echo "${ETCD_VERSION}" > "${ETCD_DIR}/version.txt"
...
@@ -103,7 +103,7 @@ echo "${ETCD_VERSION}" > "${ETCD_DIR}/version.txt"
# source_file,resource,namespace,name,old_version,new_version
# source_file,resource,namespace,name,old_version,new_version
tests
=(
tests
=(
test
/e2e/testing-manifests/rbd-storage-class.yaml,storageclasses,,slow,v1beta1,v1
"test/e2e/testing-manifests/rbd-storage-class.yaml,storageclasses,,slow,v1beta1,v1"
)
)
KUBE_OLD_API_VERSION
=
"networking.k8s.io/v1,storage.k8s.io/v1beta1,extensions/v1beta1"
KUBE_OLD_API_VERSION
=
"networking.k8s.io/v1,storage.k8s.io/v1beta1,extensions/v1beta1"
...
@@ -123,7 +123,7 @@ startApiServer ${KUBE_OLD_STORAGE_VERSIONS} ${KUBE_STORAGE_MEDIA_TYPE_JSON}
...
@@ -123,7 +123,7 @@ startApiServer ${KUBE_OLD_STORAGE_VERSIONS} ${KUBE_STORAGE_MEDIA_TYPE_JSON}
# Create object(s)
# Create object(s)
for
test
in
${
tests
[@]
}
;
do
for
test
in
"
${
tests
[@]
}
"
;
do
IFS
=
','
read
-ra
test_data
<<<
"
$test
"
IFS
=
','
read
-ra
test_data
<<<
"
$test
"
source_file
=
${
test_data
[0]
}
source_file
=
${
test_data
[0]
}
...
@@ -140,7 +140,7 @@ for test in ${tests[@]}; do
...
@@ -140,7 +140,7 @@ for test in ${tests[@]}; do
namespace
=
"
${
namespace
}
/"
namespace
=
"
${
namespace
}
/"
fi
fi
kube::log::status
"Verifying
${
resource
}
/
${
namespace
}${
name
}
has storage version
${
old_storage_version
}
in etcd"
kube::log::status
"Verifying
${
resource
}
/
${
namespace
}${
name
}
has storage version
${
old_storage_version
}
in etcd"
ETCDCTL_API
=
3
${
ETCDCTL
}
--endpoints
=
"http://
${
ETCD_HOST
}
:
${
ETCD_PORT
}
"
get
"/
${
ETCD_PREFIX
}
/
${
resource
}
/
${
namespace
}${
name
}
"
|
grep
${
old_storage_version
}
ETCDCTL_API
=
3
${
ETCDCTL
}
--endpoints
=
"http://
${
ETCD_HOST
}
:
${
ETCD_PORT
}
"
get
"/
${
ETCD_PREFIX
}
/
${
resource
}
/
${
namespace
}${
name
}
"
|
grep
"
${
old_storage_version
}
"
done
done
killApiServer
killApiServer
...
@@ -160,7 +160,7 @@ kube::log::status "Updating storage versions in etcd"
...
@@ -160,7 +160,7 @@ kube::log::status "Updating storage versions in etcd"
${
UPDATE_ETCD_OBJECTS_SCRIPT
}
${
UPDATE_ETCD_OBJECTS_SCRIPT
}
# Verify that the storage version was changed in etcd
# Verify that the storage version was changed in etcd
for
test
in
${
tests
[@]
}
;
do
for
test
in
"
${
tests
[@]
}
"
;
do
IFS
=
','
read
-ra
test_data
<<<
"
$test
"
IFS
=
','
read
-ra
test_data
<<<
"
$test
"
resource
=
${
test_data
[1]
}
resource
=
${
test_data
[1]
}
namespace
=
${
test_data
[2]
}
namespace
=
${
test_data
[2]
}
...
@@ -171,7 +171,7 @@ for test in ${tests[@]}; do
...
@@ -171,7 +171,7 @@ for test in ${tests[@]}; do
namespace
=
"
${
namespace
}
/"
namespace
=
"
${
namespace
}
/"
fi
fi
kube::log::status
"Verifying
${
resource
}
/
${
namespace
}${
name
}
has updated storage version
${
new_storage_version
}
in etcd"
kube::log::status
"Verifying
${
resource
}
/
${
namespace
}${
name
}
has updated storage version
${
new_storage_version
}
in etcd"
ETCDCTL_API
=
3
${
ETCDCTL
}
--endpoints
=
"http://
${
ETCD_HOST
}
:
${
ETCD_PORT
}
"
get
"/
${
ETCD_PREFIX
}
/
${
resource
}
/
${
namespace
}${
name
}
"
|
grep
${
new_storage_version
}
ETCDCTL_API
=
3
${
ETCDCTL
}
--endpoints
=
"http://
${
ETCD_HOST
}
:
${
ETCD_PORT
}
"
get
"/
${
ETCD_PREFIX
}
/
${
resource
}
/
${
namespace
}${
name
}
"
|
grep
"
${
new_storage_version
}
"
done
done
killApiServer
killApiServer
...
@@ -188,7 +188,7 @@ RUNTIME_CONFIG="api/all=false,api/v1=true,apiregistration.k8s.io/v1=true,${KUBE_
...
@@ -188,7 +188,7 @@ RUNTIME_CONFIG="api/all=false,api/v1=true,apiregistration.k8s.io/v1=true,${KUBE_
sleep
1
sleep
1
startApiServer
${
KUBE_NEW_STORAGE_VERSIONS
}
${
KUBE_STORAGE_MEDIA_TYPE_PROTOBUF
}
startApiServer
${
KUBE_NEW_STORAGE_VERSIONS
}
${
KUBE_STORAGE_MEDIA_TYPE_PROTOBUF
}
for
test
in
${
tests
[@]
}
;
do
for
test
in
"
${
tests
[@]
}
"
;
do
IFS
=
','
read
-ra
test_data
<<<
"
$test
"
IFS
=
','
read
-ra
test_data
<<<
"
$test
"
resource
=
${
test_data
[1]
}
resource
=
${
test_data
[1]
}
namespace
=
${
test_data
[2]
}
namespace
=
${
test_data
[2]
}
...
@@ -203,8 +203,8 @@ for test in ${tests[@]}; do
...
@@ -203,8 +203,8 @@ for test in ${tests[@]}; do
kube::log::status
"Verifying we can retrieve
${
resource
}
/
${
namespace
}${
name
}
via kubectl"
kube::log::status
"Verifying we can retrieve
${
resource
}
/
${
namespace
}${
name
}
via kubectl"
# We have to remove the cached discovery information about the old version; otherwise,
# We have to remove the cached discovery information about the old version; otherwise,
# the 'kubectl get' will use that and fail to find the resource.
# the 'kubectl get' will use that and fail to find the resource.
rm
-rf
${
HOME
}
/.kube/cache/discovery/localhost_8080/
${
KUBE_OLD_STORAGE_VERSIONS
}
rm
-rf
"
${
HOME
}
/.kube/cache/discovery/localhost_8080/
${
KUBE_OLD_STORAGE_VERSIONS
}
"
${
KUBECTL
}
get
${
namespace_flag
}
${
resource
}
/
${
name
}
${
KUBECTL
}
get
"
${
namespace_flag
}
"
"
${
resource
}
/
${
name
}
"
done
done
killApiServer
killApiServer
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment