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
57ca909d
Unverified
Commit
57ca909d
authored
Feb 14, 2018
by
Christoph Blecker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partial revert of
fb5caac2
parent
63380d12
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
46 deletions
+46
-46
update-codegen.sh
hack/update-codegen.sh
+46
-46
No files found.
hack/update-codegen.sh
View file @
57ca909d
...
@@ -38,40 +38,32 @@ informergen=$(kube::util::find-binary "informer-gen")
...
@@ -38,40 +38,32 @@ informergen=$(kube::util::find-binary "informer-gen")
# that generates the set-gen program.
# that generates the set-gen program.
#
#
IFS
=
" "
read
-ra
GROUP_VERSIONS
<<<
"
$KUBE_AVAILABLE_GROUP_VERSIONS
"
GROUP_VERSIONS
=(
${
KUBE_AVAILABLE_GROUP_VERSIONS
}
)
GV_DIRS
=()
GV_DIRS
=()
INTERNAL_DIRS
=()
INTERNAL_DIRS
=()
for
gv
in
"
${
GROUP_VERSIONS
[@]
}
"
;
do
for
gv
in
"
${
GROUP_VERSIONS
[@]
}
"
;
do
# add items, but strip off any leading apis/ you find to match command expectations
# add items, but strip off any leading apis/ you find to match command expectations
api_dir
=
$(
kube::util::group-version-to-pkg-path
"
${
gv
}
"
)
api_dir
=
$(
kube::util::group-version-to-pkg-path
"
${
gv
}
"
)
nopkg_dir
=
${
api_dir
#pkg/
}
nopkg_dir
=
${
api_dir
#pkg/
}
nopkg_dir
=
${
nopkg_dir
#vendor/k8s.io/api/
}
nopkg_dir
=
${
nopkg_dir
#vendor/k8s.io/api/
}
pkg_dir
=
${
nopkg_dir
#apis/
}
pkg_dir
=
${
nopkg_dir
#apis/
}
# skip groups that aren't being served, clients for these don't matter
# skip groups that aren't being served, clients for these don't matter
if
[[
"
${
KUBE_NONSERVER_GROUP_VERSIONS
}
"
==
*
"
${
gv
}
"
*
]]
;
then
if
[[
"
${
KUBE_NONSERVER_GROUP_VERSIONS
}
"
==
*
"
${
gv
}
"
*
]]
;
then
continue
continue
fi
fi
GV_DIRS+
=(
"
${
pkg_dir
}
"
)
GV_DIRS+
=(
"
${
pkg_dir
}
"
)
# collect internal groups
# collect internal groups
int_group
=
"
${
pkg_dir
%/*
}
/"
int_group
=
"
${
pkg_dir
%/*
}
/"
if
[[
"
${
pkg_dir
}
"
=
core/
*
]]
;
then
if
[[
"
${
pkg_dir
}
"
=
core/
*
]]
;
then
int_group
=
"api/"
int_group
=
"api/"
fi
fi
if
!
[[
"
${
INTERNAL_DIRS
[@]
:-}
"
=
~
"
${
int_group
}
"
]]
;
then
found
=
0
INTERNAL_DIRS+
=(
"
${
int_group
}
"
)
for
dir
in
"
${
INTERNAL_DIRS
[@]
}
"
;
do
fi
if
[[
"
$dir
"
=
"
$int_group
"
]]
;
then
found
=
1
break
fi
done
if
[[
$found
=
0
]]
;
then
INTERNAL_DIRS+
=(
"
$int_group
"
)
fi
done
done
# delimit by commas for the command
# delimit by commas for the command
GV_DIRS_CSV
=
$(
IFS
=
','
;
echo
"
${
GV_DIRS
[*]// /,
}
"
;
IFS
=
$)
GV_DIRS_CSV
=
$(
IFS
=
','
;
echo
"
${
GV_DIRS
[*]// /,
}
"
;
IFS
=
$)
...
@@ -82,26 +74,32 @@ INTERNAL_DIRS_CSV=$(IFS=',';echo "${INTERNAL_DIRS[*]// /,}";IFS=$)
...
@@ -82,26 +74,32 @@ INTERNAL_DIRS_CSV=$(IFS=',';echo "${INTERNAL_DIRS[*]// /,}";IFS=$)
${
clientgen
}
--input-base
=
"k8s.io/kubernetes/pkg/apis"
--input
=
"
${
INTERNAL_DIRS_CSV
}
"
"
$@
"
${
clientgen
}
--input-base
=
"k8s.io/kubernetes/pkg/apis"
--input
=
"
${
INTERNAL_DIRS_CSV
}
"
"
$@
"
${
clientgen
}
--output-base
"
${
KUBE_ROOT
}
/vendor"
--output-package
=
"k8s.io/client-go"
--clientset-name
=
"kubernetes"
--input-base
=
"k8s.io/kubernetes/vendor/k8s.io/api"
--input
=
"
${
GV_DIRS_CSV
}
"
--go-header-file
${
KUBE_ROOT
}
/hack/boilerplate/boilerplate.go.txt
"
$@
"
${
clientgen
}
--output-base
"
${
KUBE_ROOT
}
/vendor"
--output-package
=
"k8s.io/client-go"
--clientset-name
=
"kubernetes"
--input-base
=
"k8s.io/kubernetes/vendor/k8s.io/api"
--input
=
"
${
GV_DIRS_CSV
}
"
--go-header-file
${
KUBE_ROOT
}
/hack/boilerplate/boilerplate.go.txt
"
$@
"
mapfile
-t
listergen_internal_apis < <
(
listergen_internal_apis
=(
cd
"
${
KUBE_ROOT
}
"
$(
sort
<
(
find pkg/apis
-maxdepth
2
-name
types.go
-exec
dirname
{}
\;
)
cd
${
KUBE_ROOT
}
find pkg/apis
-maxdepth
2
-name
types.go | xargs
-n1
dirname
|
sort
)
)
listergen_internal_apis
=(
"
${
listergen_internal_apis
[@]/#/k8s.io/kubernetes/
}
"
)
)
listergen_internal_apis
=(
${
listergen_internal_apis
[@]/#/k8s.io/kubernetes/
})
listergen_internal_apis_csv
=
$(
IFS
=
,
;
echo
"
${
listergen_internal_apis
[*]
}
"
)
listergen_internal_apis_csv
=
$(
IFS
=
,
;
echo
"
${
listergen_internal_apis
[*]
}
"
)
${
listergen
}
--input-dirs
"
${
listergen_internal_apis_csv
}
"
"
$@
"
${
listergen
}
--input-dirs
"
${
listergen_internal_apis_csv
}
"
"
$@
"
mapfile
-t
listergen_external_apis < <
(
listergen_external_apis
=(
cd
"
${
KUBE_ROOT
}
/staging/src"
$(
sort
<
(
find k8s.io/api
-name
types.go
-exec
dirname
{}
\;
)
cd
${
KUBE_ROOT
}
/staging/src
find k8s.io/api
-name
types.go | xargs
-n1
dirname
|
sort
)
)
)
listergen_external_apis_csv
=
$(
IFS
=
,
;
echo
"
${
listergen_external_apis
[*]
}
"
)
listergen_external_apis_csv
=
$(
IFS
=
,
;
echo
"
${
listergen_external_apis
[*]
}
"
)
${
listergen
}
--output-base
"
${
KUBE_ROOT
}
/vendor"
--output-package
"k8s.io/client-go/listers"
--input-dirs
"
${
listergen_external_apis_csv
}
"
--go-header-file
${
KUBE_ROOT
}
/hack/boilerplate/boilerplate.go.txt
"
$@
"
${
listergen
}
--output-base
"
${
KUBE_ROOT
}
/vendor"
--output-package
"k8s.io/client-go/listers"
--input-dirs
"
${
listergen_external_apis_csv
}
"
--go-header-file
${
KUBE_ROOT
}
/hack/boilerplate/boilerplate.go.txt
"
$@
"
mapfile
-t
informergen_internal_apis < <
(
informergen_internal_apis
=(
cd
"
${
KUBE_ROOT
}
"
$(
sort
<
(
find pkg/apis
-maxdepth
2
-name
types.go
-exec
dirname
{}
\;
)
cd
${
KUBE_ROOT
}
find pkg/apis
-maxdepth
2
-name
types.go | xargs
-n1
dirname
|
sort
)
)
informergen_internal_apis
=(
"
${
informergen_internal_apis
[@]/#/k8s.io/kubernetes/
}
"
)
)
informergen_internal_apis
=(
${
informergen_internal_apis
[@]/#/k8s.io/kubernetes/
}
)
informergen_internal_apis_csv
=
$(
IFS
=
,
;
echo
"
${
informergen_internal_apis
[*]
}
"
)
informergen_internal_apis_csv
=
$(
IFS
=
,
;
echo
"
${
informergen_internal_apis
[*]
}
"
)
${
informergen
}
\
${
informergen
}
\
--input-dirs
"
${
informergen_internal_apis_csv
}
"
\
--input-dirs
"
${
informergen_internal_apis_csv
}
"
\
...
@@ -110,10 +108,12 @@ ${informergen} \
...
@@ -110,10 +108,12 @@ ${informergen} \
--go-header-file
${
KUBE_ROOT
}
/hack/boilerplate/boilerplate.go.txt
\
--go-header-file
${
KUBE_ROOT
}
/hack/boilerplate/boilerplate.go.txt
\
"
$@
"
"
$@
"
mapfile
-t
informergen_external_apis < <
(
informergen_external_apis
=(
cd
"
${
KUBE_ROOT
}
/staging/src"
$(
# because client-gen doesn't do policy/v1alpha1, we have to skip it too
cd
${
KUBE_ROOT
}
/staging/src
sort
<
(
find k8s.io/api
-name
types.go
-exec
dirname
{}
\;
)
|
grep
-v
pkg.apis.policy.v1alpha1
# because client-gen doesn't do policy/v1alpha1, we have to skip it too
find k8s.io/api
-name
types.go | xargs
-n1
dirname
|
sort
|
grep
-v
pkg.apis.policy.v1alpha1
)
)
)
informergen_external_apis_csv
=
$(
IFS
=
,
;
echo
"
${
informergen_external_apis
[*]
}
"
)
informergen_external_apis_csv
=
$(
IFS
=
,
;
echo
"
${
informergen_external_apis
[*]
}
"
)
...
...
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