2019-02-06 12:52:09 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -o errexit
|
|
|
|
set -o nounset
|
|
|
|
set -o pipefail
|
|
|
|
|
2019-05-13 18:24:02 +00:00
|
|
|
case "$(uname -s)" in
|
|
|
|
Linux*) linkutil=readlink;;
|
|
|
|
Darwin*) linkutil=greadlink;;
|
|
|
|
*) machine="UNKNOWN:${unameOut}"
|
|
|
|
esac
|
|
|
|
|
2019-02-06 17:51:47 +00:00
|
|
|
# get nirmata root
|
|
|
|
NIRMATA_DIR=$(dirname ${BASH_SOURCE})/..
|
2019-05-13 18:24:02 +00:00
|
|
|
NIRMATA_ROOT=$(${linkutil} -f ${NIRMATA_DIR})
|
2019-02-06 12:52:09 +00:00
|
|
|
|
2020-10-07 18:12:31 +00:00
|
|
|
# instructions to build project https://github.com/kyverno/kyverno/wiki/Building
|
2020-03-20 16:52:30 +00:00
|
|
|
|
2019-02-06 17:51:47 +00:00
|
|
|
# get relative path to code generation script
|
2020-03-20 16:52:30 +00:00
|
|
|
CODEGEN_PKG="${GOPATH}/src/k8s.io/code-generator"
|
2019-02-06 12:52:09 +00:00
|
|
|
|
2019-02-06 17:51:47 +00:00
|
|
|
# get relative path of nirmata
|
|
|
|
NIRMATA_PKG=${NIRMATA_ROOT#"${GOPATH}/src/"}
|
|
|
|
|
|
|
|
# perform code generation
|
|
|
|
${CODEGEN_PKG}/generate-groups.sh \
|
2022-04-27 12:30:43 +00:00
|
|
|
"client,informer,lister" \
|
2019-02-06 17:51:47 +00:00
|
|
|
${NIRMATA_PKG}/pkg/client \
|
2022-04-27 12:30:43 +00:00
|
|
|
${NIRMATA_PKG}/api \
|
2022-04-12 17:07:28 +00:00
|
|
|
"kyverno:v1 kyverno:v1beta1 kyverno:v1alpha2 policyreport:v1alpha2"
|