mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-27 16:17:34 +00:00
CodeQL / Analyze (go) (push) Failing after 6m23s
Definition-Lint / definition-doc (push) Failing after 3m8s
E2E MultiCluster Test / detect-noop (push) Successful in 6s
E2E Test / detect-noop (push) Successful in 3s
Go / detect-noop (push) Successful in 2s
license / Check for unapproved licenses (push) Failing after 18s
Registry / publish-core-images (push) Failing after 1m4s
Unit-Test / detect-noop (push) Successful in 20s
Sync SDK / sync_sdk (push) Failing after 3m9s
Go / staticcheck (push) Successful in 6m17s
Go / check-diff (push) Failing after 19m4s
Go / check-core-image-build (push) Failing after 5m44s
Go / check-cli-image-build (push) Failing after 3m31s
Unit-Test / unit-tests (push) Failing after 13m54s
Go / lint (push) Failing after 1h53m27s
Scorecards supply-chain security / Scorecards analysis (push) Failing after 1m27s
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Has been cancelled
E2E Test / e2e-tests (v1.29) (push) Has been cancelled
Go / check-windows (push) Has been cancelled
* chore: update k8s to 1.29 Signed-off-by: phantomnat <w.nattadej@gmail.com> * fix: unit test Signed-off-by: phantomnat <w.nattadej@gmail.com> * fix: lint Signed-off-by: phantomnat <w.nattadej@gmail.com> * fix: lint Signed-off-by: phantomnat <w.nattadej@gmail.com> * fix: e2e Signed-off-by: phantomnat <w.nattadej@gmail.com> * fix: lint and e2e test Signed-off-by: phantomnat <w.nattadej@gmail.com> * test(e2e): increase timeout Signed-off-by: phantomnat <w.nattadej@gmail.com> * fix e2e and scripts Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com> * make reviewable Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com> * rollback a unnecessary ut change Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com> * update go.mod to import merged workflow Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com> --------- Signed-off-by: phantomnat <w.nattadej@gmail.com> Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com> Co-authored-by: phantomnat <w.nattadej@gmail.com>
98 lines
2.8 KiB
Bash
Executable File
98 lines
2.8 KiB
Bash
Executable File
#!/bin/bash -l
|
|
#
|
|
# Copyright 2021. The KubeVela Authors.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
#
|
|
|
|
set -e
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")/../.."
|
|
|
|
WORK_TEMP_DIR="./clientgen_work_temp"
|
|
|
|
# client generator parameters
|
|
CODEGEN_GENERATORS="all" # deepcopy,defaulter,client,lister,informer or all
|
|
OUTPUT_PACKAGE="github.com/oam-dev/kubevela/pkg/generated/client"
|
|
APIS_PACKAGE="github.com/oam-dev/kubevela/apis"
|
|
CODEGEN_GROUP_VERSIONS="core.oam.dev:v1beta1"
|
|
OUTPUT_DIR="${WORK_TEMP_DIR}"
|
|
BOILERPLATE_FILE="./hack/boilerplate.go.txt"
|
|
|
|
installDep() {
|
|
cp go.mod go.sum "${WORK_TEMP_DIR}/backup/"
|
|
|
|
cat <<EOF >"${WORK_TEMP_DIR}/tools.go"
|
|
// +build tools
|
|
|
|
package tools
|
|
|
|
import _ "k8s.io/code-generator"
|
|
EOF
|
|
go get github.com/oam-dev/kubevela/clientgen_work_temp
|
|
go mod vendor
|
|
}
|
|
|
|
clientGen() {
|
|
# TODO: better migrate this to kube_codegen.sh (https://github.com/kubernetes/sample-controller/blob/master/hack/update-codegen.sh)
|
|
chmod +x ./vendor/k8s.io/code-generator/generate-groups.sh
|
|
chmod +x ./vendor/k8s.io/code-generator/generate-internal-groups.sh
|
|
bash ./vendor/k8s.io/code-generator/generate-groups.sh "${CODEGEN_GENERATORS}" \
|
|
${OUTPUT_PACKAGE} \
|
|
${APIS_PACKAGE} \
|
|
"${CODEGEN_GROUP_VERSIONS}" \
|
|
--output-base "${OUTPUT_DIR}" \
|
|
--go-header-file "${BOILERPLATE_FILE}"
|
|
|
|
rm -rf ./pkg/generated/
|
|
mkdir -p ./pkg/generated/
|
|
mv "${WORK_TEMP_DIR}/github.com/oam-dev/kubevela/pkg/generated/client" ./pkg/generated/
|
|
}
|
|
|
|
EXPECTED_CONTROLLER_GEN_VERSION=v0.14.0
|
|
CONTROLLER_GEN="$(go env GOPATH)"/bin/controller-gen
|
|
|
|
deepcopyGen() {
|
|
echo "generating zz_generated.deepcopy"
|
|
if ! command -v "$CONTROLLER_GEN" &> /dev/null; then
|
|
VERSION="NOT_INSTALLED"
|
|
else
|
|
VERSION=$($CONTROLLER_GEN --version)
|
|
fi
|
|
if [ "$VERSION" == "Version: ${EXPECTED_CONTROLLER_GEN_VERSION}" ]; then
|
|
echo "controller-gen is already installed"
|
|
:
|
|
else
|
|
echo "installing new controller-gen: ${VERSION}=>${EXPECTED_CONTROLLER_GEN_VERSION}"
|
|
rm -rf "$CONTROLLER_GEN"
|
|
GOBIN="$(go env GOPATH)"/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen@${EXPECTED_CONTROLLER_GEN_VERSION}
|
|
fi
|
|
$CONTROLLER_GEN object:headerFile="./hack/boilerplate.go.txt" paths="./apis/..."
|
|
}
|
|
|
|
cleanup() {
|
|
mv "${WORK_TEMP_DIR}/backup/"* ./
|
|
rm -drf "${WORK_TEMP_DIR:?}/"
|
|
rm -drf vendor
|
|
}
|
|
|
|
main() {
|
|
mkdir -p "${WORK_TEMP_DIR}/backup/"
|
|
installDep
|
|
clientGen
|
|
cleanup
|
|
}
|
|
|
|
main
|
|
deepcopyGen
|