Fix scripts to not rely on codegen scripts being executable

If someone doesn't have code-generator in their GOPATH, they'll need to
run `go mod vendor` to populate the vendor directory with the code-generator
repo (it is required by `hack/tools.go`).

However, `go mod vendor` does not mark scripts as executable which leads to a
`Permission denied` error while trying to run `update-codegen.sh` in staging repos.
So fix scripts to not rely on codegen scripts being executable.
This commit is contained in:
Nikhita Raghunath 2019-06-16 22:00:57 +05:30
parent de091d102f
commit 391da79abd
6 changed files with 8 additions and 8 deletions

View File

@ -25,7 +25,7 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-
# --output-base because this script should also be able to run inside the vendor dir of
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
# instead of the $GOPATH directly. For normal projects this can be dropped.
"${CODEGEN_PKG}/generate-groups.sh" all \
bash "${CODEGEN_PKG}/generate-groups.sh" all \
k8s.io/apiextensions-apiserver/examples/client-go/pkg/client k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis \
cr:v1 \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../../../.."

View File

@ -27,7 +27,7 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-
# instead of the $GOPATH directly. For normal projects this can be dropped.
CLIENTSET_NAME_VERSIONED=clientset \
CLIENTSET_NAME_INTERNAL=internalclientset \
"${CODEGEN_PKG}/generate-internal-groups.sh" all \
bash "${CODEGEN_PKG}/generate-internal-groups.sh" all \
k8s.io/apiextensions-apiserver/pkg/client k8s.io/apiextensions-apiserver/pkg/apis k8s.io/apiextensions-apiserver/pkg/apis \
"apiextensions:v1beta1" \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \

View File

@ -23,7 +23,7 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-
CLIENTSET_NAME_VERSIONED=clientset \
CLIENTSET_PKG_NAME=clientset_generated \
"${CODEGEN_PKG}/generate-groups.sh" deepcopy,client,lister,informer \
bash "${CODEGEN_PKG}/generate-groups.sh" deepcopy,client,lister,informer \
k8s.io/kube-aggregator/pkg/client k8s.io/kube-aggregator/pkg/apis \
"apiregistration:v1beta1,v1" \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
@ -32,7 +32,7 @@ CLIENTSET_PKG_NAME=clientset_generated \
CLIENTSET_NAME_VERSIONED=clientset \
CLIENTSET_PKG_NAME=clientset_generated \
CLIENTSET_NAME_INTERNAL=internalclientset \
"${CODEGEN_PKG}/generate-internal-groups.sh" deepcopy,client,lister,informer,conversion \
bash "${CODEGEN_PKG}/generate-internal-groups.sh" deepcopy,client,lister,informer,conversion \
k8s.io/kube-aggregator/pkg/client k8s.io/kube-aggregator/pkg/apis k8s.io/kube-aggregator/pkg/apis \
"apiregistration:v1beta1,v1" \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \

View File

@ -28,12 +28,12 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-
#
# we skip informers and listers for metrics, because we don't quite support the requisite operations yet
# we skip generating the internal clientset as it's not really needed
"${CODEGEN_PKG}/generate-internal-groups.sh" deepcopy,conversion \
bash "${CODEGEN_PKG}/generate-internal-groups.sh" deepcopy,conversion \
k8s.io/metrics/pkg/client k8s.io/metrics/pkg/apis k8s.io/metrics/pkg/apis \
"metrics:v1alpha1,v1beta1 custom_metrics:v1beta1 external_metrics:v1beta1" \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
--go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
"${CODEGEN_PKG}/generate-groups.sh" client \
bash "${CODEGEN_PKG}/generate-groups.sh" client \
k8s.io/metrics/pkg/client k8s.io/metrics/pkg/apis \
"metrics:v1alpha1,v1beta1" \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \

View File

@ -25,7 +25,7 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-
# --output-base because this script should also be able to run inside the vendor dir of
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
# instead of the $GOPATH directly. For normal projects this can be dropped.
"${CODEGEN_PKG}/generate-groups.sh" "deepcopy,client,informer,lister" \
bash "${CODEGEN_PKG}/generate-groups.sh" "deepcopy,client,informer,lister" \
k8s.io/node-api/pkg/client k8s.io/node-api/pkg/apis \
"node:v1alpha1" \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \

View File

@ -25,7 +25,7 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-
# --output-base because this script should also be able to run inside the vendor dir of
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
# instead of the $GOPATH directly. For normal projects this can be dropped.
"${CODEGEN_PKG}"/generate-groups.sh "deepcopy,client,informer,lister" \
bash "${CODEGEN_PKG}"/generate-groups.sh "deepcopy,client,informer,lister" \
k8s.io/sample-controller/pkg/generated k8s.io/sample-controller/pkg/apis \
samplecontroller:v1alpha1 \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \