Skip to content

Commit

Permalink
Merge pull request #1327 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1325-to-release-4.12

[release-4.12] OCPBUGS-6600: Fix kube version from 1.24.1 to 1.25.2
  • Loading branch information
openshift-merge-robot committed Jan 31, 2023
2 parents 854f807 + 19e02cc commit b05f7d4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Makefile
Expand Up @@ -13,9 +13,12 @@ include $(addprefix ./vendor/github.com/openshift/build-machinery-go/make/, \
targets/openshift/deps-gomod.mk \
)

KUBE_GIT_MINOR_VERSION := "25"
KUBE_GIT_VERSION := "v1.25.2"

GO_LD_EXTRAFLAGS :=-X k8s.io/component-base/version.gitMajor="1" \
-X k8s.io/component-base/version.gitMinor="24" \
-X k8s.io/component-base/version.gitVersion="v1.24.1" \
-X k8s.io/component-base/version.gitMinor=$(KUBE_GIT_MINOR_VERSION) \
-X k8s.io/component-base/version.gitVersion=$(KUBE_GIT_VERSION) \
-X k8s.io/component-base/version.gitCommit="$(SOURCE_GIT_COMMIT)" \
-X k8s.io/component-base/version.buildDate="$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')" \
-X k8s.io/component-base/version.gitTreeState="clean" \
Expand Down Expand Up @@ -72,7 +75,7 @@ oc: build
update: update-generated-completions
.PHONY: update

verify: verify-cli-conventions verify-generated-completions
verify: verify-cli-conventions verify-generated-completions verify-kube-version
.PHONY: verify

verify-cli-conventions:
Expand All @@ -87,6 +90,10 @@ verify-generated-completions: build
hack/verify-generated-completions.sh
.PHONY: verify-generated-completions

verify-kube-version: build
KUBE_GIT_VERSION=$(KUBE_GIT_VERSION) hack/verify-kube-version.sh
.PHONY: verify-kube-version

generate-docs:
go run ./tools/gendocs
.PHONY: generate-docs
Expand Down
11 changes: 11 additions & 0 deletions hack/verify-kube-version.sh
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

source "$(dirname "${BASH_SOURCE}")/lib/init.sh"

KUBECTL_GO_MOD_VERSION=$(grep "k8s.io/kubectl" go.mod | sed 's/[\t]k8s.io\/kubectl v0.//')
KUBECTL_GIT_VERSION="${KUBE_GIT_VERSION//v1./}"

if [[ "${KUBECTL_GO_MOD_VERSION}" != "${KUBECTL_GIT_VERSION}" ]]; then
os::log::warning "kubernetes version and kubectl version in go.mod must be equal, please update KUBE_GIT_VERSION"
exit 1
fi

0 comments on commit b05f7d4

Please sign in to comment.