Skip to content

Commit

Permalink
Merge pull request #352 from xiaods/dev
Browse files Browse the repository at this point in the history
fix: validate script update
  • Loading branch information
xiaods authored Oct 21, 2024
2 parents ab183a5 + f36ba62 commit b83a252
Showing 1 changed file with 5 additions and 13 deletions.
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

0 comments on commit b83a252

Please sign in to comment.