Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: validate script update #352

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions hack/validate
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ go mod tidy
echo Running: go generate
GOOS=linux CC=gcc CXX=g++ go generate

echo Running: go mod vendor
go mod vendor

if [ -n "$SKIP_VALIDATE" ]; then
echo Skipping validation
exit
fi
echo Running validation

. ./hack/version.sh
Expand All @@ -28,10 +21,8 @@ if [ -n "$DIRTY" ]; then
fi

echo Running: go version
DEPENDENCIES_URL="https://raw.githubusercontent.com/kubernetes/kubernetes/${VERSION_K8S}/build/dependencies.yaml"
GOLANG_VERSION=$(curl -sL "${DEPENDENCIES_URL}" | yq e '.dependencies[] | select(.name == "golang: upstream version").version' -)
if ! go version | grep -s "go version go${GOLANG_VERSION} "; then
echo "Unexpected $(go version) - Kubernetes ${VERSION_K8S} should be built with go version go${GOLANG_VERSION}"
if ! go version | grep -s "go version ${VERSION_GOLANG} "; then
echo "Unexpected $(go version) - Kubernetes ${VERSION_K8S} should be built with go version ${VERSION_GOLANG}"
exit 1
fi

Expand All @@ -47,5 +38,6 @@ if ! command -v golangci-lint; then
exit
fi

echo Running: golangci-lint
golangci-lint run -v
#echo Running: golangci-lint
## https://github.com/golangci/golangci-lint/issues/2788
#CGO_ENABLED=0 golangci-lint run -v
Loading