-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
update-generated-clientsets.sh
executable file
·48 lines (41 loc) · 1.67 KB
/
update-generated-clientsets.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
source "$(dirname "${BASH_SOURCE}")/lib/init.sh"
os::build::setup_env
os::util::ensure::built_binary_exists 'client-gen' 'vendor/k8s.io/kubernetes/cmd/libs/go2idl/client-gen'
# list of package to generate client set for
packages=(
github.com/openshift/origin/pkg/authorization
github.com/openshift/origin/pkg/build
github.com/openshift/origin/pkg/apps
github.com/openshift/origin/pkg/image
github.com/openshift/origin/pkg/oauth
github.com/openshift/origin/pkg/project
github.com/openshift/origin/pkg/quota
github.com/openshift/origin/pkg/route
github.com/openshift/origin/pkg/sdn
github.com/openshift/origin/pkg/template
github.com/openshift/origin/pkg/user
)
function generate_clientset_for() {
local package="$1";shift
local name="$1";shift
echo "-- Generating ${name} client set for ${package} ..."
client-gen --clientset-path="${package}/generated" \
--input-base="${package}" \
--output-base="../../.." \
--clientset-name="${name}" \
--go-header-file=hack/boilerplate.txt \
"$@"
}
verify="${VERIFY:-}"
# remove the old client sets
for pkg in "${packages[@]}"; do
if [[ -z "${verify}" ]]; then
go list -f '{{.Dir}}' "${pkg}/generated/clientset/..." "${pkg}/generated/internalclientset/..." | xargs rm -rf
fi
done
for pkg in "${packages[@]}"; do
shortGroup=$(basename "${pkg}")
generate_clientset_for "${pkg}" "internalclientset" --group=${shortGroup} --input=api/ "$@"
generate_clientset_for "${pkg}" "clientset" --group=${shortGroup} --version=v1 --input=api/v1 "$@"
done