update-codegen.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/bash
  2. # Copyright 2014 The Kubernetes Authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. set -o errexit
  16. set -o nounset
  17. set -o pipefail
  18. KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
  19. source "${KUBE_ROOT}/hack/lib/init.sh"
  20. kube::golang::setup_env
  21. BUILD_TARGETS=(
  22. cmd/libs/go2idl/client-gen
  23. cmd/libs/go2idl/set-gen
  24. )
  25. make -C "${KUBE_ROOT}" WHAT="${BUILD_TARGETS[*]}"
  26. clientgen=$(kube::util::find-binary "client-gen")
  27. setgen=$(kube::util::find-binary "set-gen")
  28. # Please do not add any logic to this shell script. Add logic to the go code
  29. # that generates the set-gen program.
  30. #
  31. # This can be called with one flag, --verify-only, so it works for both the
  32. # update- and verify- scripts.
  33. ${clientgen} "$@"
  34. ${clientgen} -t "$@"
  35. ${clientgen} --clientset-name="release_1_4" --input="api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1"
  36. # Clientgen for federation clientset.
  37. ${clientgen} --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --input="../../federation/apis/federation/","api/","extensions/" --included-types-overrides="api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,api/Event" "$@"
  38. ${clientgen} --clientset-name=federation_release_1_4 --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --input="../../federation/apis/federation/v1beta1","api/v1","extensions/v1beta1" --included-types-overrides="api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,api/v1/Event" "$@"
  39. ${setgen} "$@"
  40. # You may add additional calls of code generators like set-gen above.