hack/update-generated-clientsets.sh
6334b816
 #!/bin/bash
614bf6cc
 source "$(dirname "${BASH_SOURCE}")/lib/init.sh"
6334b816
 
f0eadcca
 os::build::setup_env
 
a2913dfd
 os::util::ensure::built_binary_exists 'client-gen' 'vendor/k8s.io/kubernetes/cmd/libs/go2idl/client-gen'
6334b816
 
d2362390
 # list of package to generate client set for
6334b816
 packages=(
   github.com/openshift/origin/pkg/authorization
   github.com/openshift/origin/pkg/build
   github.com/openshift/origin/pkg/deploy
   github.com/openshift/origin/pkg/image
   github.com/openshift/origin/pkg/oauth
   github.com/openshift/origin/pkg/project
   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
d2362390
   echo "-- Generating ${name} client set for ${package} ..."
dbf0971a
   client-gen --clientset-path="${package}/client/clientset_generated" \
cfa919f9
              --clientset-api-path="/oapi"                             \
6334b816
              --input-base="${package}/api"                            \
              --output-base="../../.."                                 \
              --clientset-name="${name}"                               \
d2362390
              --go-header-file=hack/boilerplate.txt                    \
6334b816
              "$@"
 }
 
 verify="${VERIFY:-}"
 
d2362390
 # remove the old client sets
6334b816
 for pkg in "${packages[@]}"; do
   if [[ -z "${verify}" ]]; then
     go list -f '{{.Dir}}' "${pkg}/client/clientset_generated/..." | xargs rm -rf
   fi
 done
 
d2362390
 # get the tag name for the current origin release
 os::build::get_version_vars
 origin_version="v${OS_GIT_MAJOR}_${OS_GIT_MINOR%+}"
 
6334b816
 for pkg in "${packages[@]}"; do
   generate_clientset_for "${pkg}" "internalclientset" --input=api/ "$@"
   generate_clientset_for "${pkg}" "release_${origin_version}" --input=api/v1 "$@"
 done