Files
kuberay/ray-operator/hack/update-codegen.sh
b543cd35cb [cherry-pick] Changes required make a build after update of component-base (#3004) (#3163)
* Changes required make a build after update of component-base (#3004)

* Update packages required for bump to component-base

* Update version of controller-gen required by packages update

Migrate to kube_codegen.sh

* Sync CRDs post generator update

* Docker and go-toolchain update

* Update tests to align with package changes

A in SetFeatureGateDuringTest, that stopped returning a cleanup func - https://github.com/kubernetes/kubernetes/issues/123677
Required tests update to not use `It()` while it could be `By()` as using `It()` resulted in parallel access to the feature gates.

* Change enforced by golangci-lint - fieldalignment

* Regenerate client code with new generator

* [CI] fix locust versions (#3100)

Signed-off-by: Rueian <[email protected]>

* [ci] remove the test for modin because its certificate is broken (#3135)

Signed-off-by: Rueian <[email protected]>

---------

Signed-off-by: Rueian <[email protected]>
Co-authored-by: Rueian <[email protected]>
2025-03-12 07:22:27 -04:00

43 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# This shell is used to auto generate some useful tools for k8s, such as clientset, lister, informer and so on.
# We don't use this tool to generate deepcopy because kubebuilder (controller-tools) has coverred that part.
set -o errexit
set -o nounset
set -o pipefail
GOPATH=$(go env GOPATH)
export GOPATH
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
ROOT_PKG=github.com/ray-project/kuberay/ray-operator
CODEGEN_PKG=$(go list -m -f "{{.Dir}}" k8s.io/code-generator)
if [[ ! -d ${CODEGEN_PKG} ]]; then
echo "${CODEGEN_PKG} is missing. Running 'go mod download'."
go mod download
CODEGEN_PKG=$(go list -m -f "{{.Dir}}" k8s.io/code-generator)
fi
echo ">> Using ${CODEGEN_PKG}"
cd "${SCRIPT_ROOT}"
# shellcheck source=/dev/null
source "${CODEGEN_PKG}/kube_codegen.sh"
# Generating conversion and defaults functions
kube::codegen::gen_helpers \
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
"${SCRIPT_ROOT}/apis"
kube::codegen::gen_client \
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
--output-dir "${SCRIPT_ROOT}/pkg/client" \
--output-pkg "${ROOT_PKG}/pkg/client" \
--with-watch \
--with-applyconfig \
--applyconfig-externals k8s.io/api/core/v1.PodTemplateSpec:k8s.io/client-go/applyconfigurations/core/v1 \
--one-input-api ray/v1 \
"${SCRIPT_ROOT}/apis"