fix: generate manifests
This commit is contained in:
22
hack/generate_manifests.sh
Executable file
22
hack/generate_manifests.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
CRD_OPTIONS="$1"
|
||||
PKGS="$2"
|
||||
IFS=" " read -r -a PKGS <<< "${PKGS}"
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
cd "${KUBE_ROOT}" || exit
|
||||
|
||||
for PKG in "${PKGS[@]}"; do
|
||||
echo "Generating manifests for ${PKG}"
|
||||
if [[ "$PKG" =~ /\*$ ]]; then
|
||||
PKG=${PKG%??}
|
||||
DIR=$(go list -e -test=false -export=false -deps=false -find=false -tags ignore_autogenerated -f "{{.Dir}}" "kubesphere.io/api/${PKG}")
|
||||
# shellcheck disable=SC2010
|
||||
ls -1 -F "${DIR}" | grep '/$' | xargs -n 1 -I{} go run ./vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go object:headerFile=./hack/boilerplate.go.txt paths=kubesphere.io/api/"${PKG}"/{} rbac:roleName=controller-perms "${CRD_OPTIONS}" output:crd:artifacts:config=config/crds
|
||||
else
|
||||
go run ./vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go object:headerFile=./hack/boilerplate.go.txt paths=kubesphere.io/api/"${PKG}" rbac:roleName=controller-perms "${CRD_OPTIONS}" output:crd:artifacts:config=config/crds
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user