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
2393799e
Commit
2393799e
authored
Feb 05, 2019
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hack/update-openapi-spec.sh: normalize indention of spec through jq
parent
999e2e0c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
util.sh
hack/lib/util.sh
+14
-6
update-openapi-spec.sh
hack/update-openapi-spec.sh
+2
-1
No files found.
hack/lib/util.sh
View file @
2393799e
...
@@ -339,10 +339,9 @@ kube::util::create-fake-git-tree() {
...
@@ -339,10 +339,9 @@ kube::util::create-fake-git-tree() {
kube::util::godep_restored
()
{
kube::util::godep_restored
()
{
local
-r
godeps_json
=
${
1
:-
Godeps
/Godeps.json
}
local
-r
godeps_json
=
${
1
:-
Godeps
/Godeps.json
}
local
-r
gopath
=
${
2
:-${
GOPATH
%
:
*
}}
local
-r
gopath
=
${
2
:-${
GOPATH
%
:
*
}}
if
!
which jq &>/dev/null
;
then
echo
"jq not found. Please install."
1>&2
kube::util::require-jq
return
1
fi
local
root
local
root
local
old_rev
=
""
local
old_rev
=
""
while
read
path rev
;
do
while
read
path rev
;
do
...
@@ -461,7 +460,7 @@ kube::util::base_ref() {
...
@@ -461,7 +460,7 @@ kube::util::base_ref() {
fi
fi
full_branch
=
"
$(
kube::util::git_upstream_remote_name
)
/
${
git_branch
}
"
full_branch
=
"
$(
kube::util::git_upstream_remote_name
)
/
${
git_branch
}
"
# make sure the branch is valid, otherwise the check will pass erroneously.
# make sure the branch is valid, otherwise the check will pass erroneously.
if
!
git describe
"
${
full_branch
}
"
>
/dev/null
;
then
if
!
git describe
"
${
full_branch
}
"
>
/dev/null
;
then
# abort!
# abort!
...
@@ -479,7 +478,7 @@ kube::util::has_changes() {
...
@@ -479,7 +478,7 @@ kube::util::has_changes() {
local
-r
git_branch
=
$1
local
-r
git_branch
=
$1
local
-r
pattern
=
$2
local
-r
pattern
=
$2
local
-r
not_pattern
=
${
3
:-
totallyimpossiblepattern
}
local
-r
not_pattern
=
${
3
:-
totallyimpossiblepattern
}
local
base_ref
=
$(
kube::util::base_ref
"
${
git_branch
}
"
)
local
base_ref
=
$(
kube::util::base_ref
"
${
git_branch
}
"
)
echo
"Checking for '
${
pattern
}
' changes against '
${
base_ref
}
'"
echo
"Checking for '
${
pattern
}
' changes against '
${
base_ref
}
'"
...
@@ -792,6 +791,15 @@ function kube::util::check-file-in-alphabetical-order {
...
@@ -792,6 +791,15 @@ function kube::util::check-file-in-alphabetical-order {
fi
fi
}
}
# kube::util::require-jq
# Checks whether jq is installed.
function
kube::util::require-jq
{
if
!
which jq &>/dev/null
;
then
echo
"jq not found. Please install."
1>&2
return
1
fi
}
# Some useful colors.
# Some useful colors.
if
[[
-z
"
${
color_start
-
}
"
]]
;
then
if
[[
-z
"
${
color_start
-
}
"
]]
;
then
declare
-r
color_start
=
"
\0
33["
declare
-r
color_start
=
"
\0
33["
...
...
hack/update-openapi-spec.sh
View file @
2393799e
...
@@ -25,6 +25,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
...
@@ -25,6 +25,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
OPENAPI_ROOT_DIR
=
"
${
KUBE_ROOT
}
/api/openapi-spec"
OPENAPI_ROOT_DIR
=
"
${
KUBE_ROOT
}
/api/openapi-spec"
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
kube::util::require-jq
kube::golang::setup_env
kube::golang::setup_env
make
-C
"
${
KUBE_ROOT
}
"
WHAT
=
cmd/kube-apiserver
make
-C
"
${
KUBE_ROOT
}
"
WHAT
=
cmd/kube-apiserver
...
@@ -83,7 +84,7 @@ fi
...
@@ -83,7 +84,7 @@ fi
kube::log::status
"Updating "
${
OPENAPI_ROOT_DIR
}
kube::log::status
"Updating "
${
OPENAPI_ROOT_DIR
}
curl
-w
"
\n
"
-fs
"
${
API_HOST
}
:
${
API_PORT
}
/openapi/v2"
>
"
${
OPENAPI_ROOT_DIR
}
/swagger.json"
curl
-w
"
\n
"
-fs
"
${
API_HOST
}
:
${
API_PORT
}
/openapi/v2"
| jq
-S
.
>
"
${
OPENAPI_ROOT_DIR
}
/swagger.json"
kube::log::status
"SUCCESS"
kube::log::status
"SUCCESS"
...
...
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