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
4231fa09
Commit
4231fa09
authored
Apr 04, 2019
by
SataQiu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix shellcheck failures of hack/lib/logging.sh hack/lib/protoc.sh
parent
c2877f86
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
12 deletions
+10
-12
.shellcheck_failures
hack/.shellcheck_failures
+0
-2
logging.sh
hack/lib/logging.sh
+2
-2
protoc.sh
hack/lib/protoc.sh
+8
-8
No files found.
hack/.shellcheck_failures
View file @
4231fa09
...
@@ -33,8 +33,6 @@
...
@@ -33,8 +33,6 @@
./hack/jenkins/upload-to-gcs.sh
./hack/jenkins/upload-to-gcs.sh
./hack/jenkins/verify-dockerized.sh
./hack/jenkins/verify-dockerized.sh
./hack/lib/init.sh
./hack/lib/init.sh
./hack/lib/logging.sh
./hack/lib/protoc.sh
./hack/lib/swagger.sh
./hack/lib/swagger.sh
./hack/lib/test.sh
./hack/lib/test.sh
./hack/lib/version.sh
./hack/lib/version.sh
...
...
hack/lib/logging.sh
View file @
4231fa09
...
@@ -20,7 +20,7 @@ KUBE_VERBOSE="${KUBE_VERBOSE:-5}"
...
@@ -20,7 +20,7 @@ KUBE_VERBOSE="${KUBE_VERBOSE:-5}"
# Handler for when we exit automatically on an error.
# Handler for when we exit automatically on an error.
# Borrowed from https://gist.github.com/ahendrix/7030300
# Borrowed from https://gist.github.com/ahendrix/7030300
kube::log::errexit
()
{
kube::log::errexit
()
{
local
err
=
"
${
PIPESTATUS
[
@
]
}
"
local
err
=
"
${
PIPESTATUS
[
*
]
}
"
# If the shell we are in doesn't have errexit set (common in subshells) then
# If the shell we are in doesn't have errexit set (common in subshells) then
# don't dump stacks.
# don't dump stacks.
...
@@ -60,7 +60,7 @@ kube::log::stack() {
...
@@ -60,7 +60,7 @@ kube::log::stack() {
if
[[
${#
FUNCNAME
[@]
}
-gt
${
stack_skip
}
]]
;
then
if
[[
${#
FUNCNAME
[@]
}
-gt
${
stack_skip
}
]]
;
then
echo
"Call stack:"
>
&2
echo
"Call stack:"
>
&2
local
i
local
i
for
((
i
=
1
;
i <
=
${#
FUNCNAME
[@]
}
-
${
stack_skip
}
;
i++
))
for
((
i
=
1
;
i <
=
${#
FUNCNAME
[@]
}
-
stack_skip
;
i++
))
do
do
local
frame_no
=
$((
i
-
1
+
stack_skip
))
local
frame_no
=
$((
i
-
1
+
stack_skip
))
local
source_file
=
${
BASH_SOURCE
[
${
frame_no
}
]
}
local
source_file
=
${
BASH_SOURCE
[
${
frame_no
}
]
}
...
...
hack/lib/protoc.sh
View file @
4231fa09
...
@@ -19,7 +19,7 @@ set -o nounset
...
@@ -19,7 +19,7 @@ set -o nounset
set
-o
pipefail
set
-o
pipefail
# The root of the build/dist directory
# The root of the build/dist directory
KUBE_ROOT
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../.."
&&
pwd
-P
)
"
KUBE_ROOT
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
/../.."
&&
pwd
-P
)
"
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
# Generates $1/api.pb.go from the protobuf file $1/api.proto
# Generates $1/api.pb.go from the protobuf file $1/api.proto
...
@@ -35,8 +35,8 @@ function kube::protoc::generate_proto() {
...
@@ -35,8 +35,8 @@ function kube::protoc::generate_proto() {
kube::protoc::check_protoc
kube::protoc::check_protoc
local
package
=
${
1
}
local
package
=
${
1
}
kube::protoc::protoc
${
package
}
kube::protoc::protoc
"
${
package
}
"
kube::protoc::format
${
package
}
kube::protoc::format
"
${
package
}
"
}
}
# Checks that the current protoc version is at least version 3.0.0-beta1
# Checks that the current protoc version is at least version 3.0.0-beta1
...
@@ -62,7 +62,7 @@ function kube::protoc::protoc() {
...
@@ -62,7 +62,7 @@ function kube::protoc::protoc() {
PATH
=
"
${
gogopath
}
:
${
PATH
}
"
protoc
\
PATH
=
"
${
gogopath
}
:
${
PATH
}
"
protoc
\
--proto_path
=
"
${
package
}
"
\
--proto_path
=
"
${
package
}
"
\
--proto_path
=
"
${
KUBE_ROOT
}
/vendor"
\
--proto_path
=
"
${
KUBE_ROOT
}
/vendor"
\
--gogo_out
=
plugins
=
grpc:
${
package
}
${
package
}
/api.proto
--gogo_out
=
plugins
=
grpc:
"
${
package
}
"
"
${
package
}
/api.proto"
}
}
# Formats $1/api.pb.go, adds the boilerplate comments and run gofmt on it
# Formats $1/api.pb.go, adds the boilerplate comments and run gofmt on it
...
@@ -71,20 +71,20 @@ function kube::protoc::format() {
...
@@ -71,20 +71,20 @@ function kube::protoc::format() {
local
package
=
${
1
}
local
package
=
${
1
}
# Update boilerplate for the generated file.
# Update boilerplate for the generated file.
echo
"
$(
cat
hack/boilerplate/boilerplate.generatego.txt
${
package
}
/api.pb.go
)
"
>
${
package
}
/api.pb.go
cat
hack/boilerplate/boilerplate.generatego.txt
"
${
package
}
/api.pb.go"
>
tmpfile
&&
mv
tmpfile
"
${
package
}
/api.pb.go"
# Run gofmt to clean up the generated code.
# Run gofmt to clean up the generated code.
kube::golang::verify_go_version
kube::golang::verify_go_version
gofmt
-l
-s
-w
${
package
}
/api.pb.go
gofmt
-l
-s
-w
"
${
package
}
/api.pb.go"
}
}
# Compares the contents of $1 and $2
# Compares the contents of $1 and $2
# Echo's $3 in case of error and exits 1
# Echo's $3 in case of error and exits 1
function
kube::protoc::diff
()
{
function
kube::protoc::diff
()
{
local
ret
=
0
local
ret
=
0
diff
-I
"gzipped FileDescriptorProto"
-I
"0x"
-Naupr
${
1
}
${
2
}
||
ret
=
$?
diff
-I
"gzipped FileDescriptorProto"
-I
"0x"
-Naupr
"
${
1
}
"
"
${
2
}
"
||
ret
=
$?
if
[[
${
ret
}
-ne
0
]]
;
then
if
[[
${
ret
}
-ne
0
]]
;
then
echo
${
3
}
echo
"
${
3
}
"
exit
1
exit
1
fi
fi
}
}
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