From 664bdffdf0cda63a08bc9979031c68aea8a49041 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Wed, 15 Sep 2021 12:12:26 -0700 Subject: [PATCH] Bump golang and default metrics-server version Signed-off-by: Brad Davidson --- Dockerfile | 18 ++++++++++++++---- Makefile | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4da3718..722af86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ ARG UBI_IMAGE=registry.access.redhat.com/ubi7/ubi-minimal:latest -ARG GO_IMAGE=rancher/hardened-build-base:v1.16.4b7 +ARG GO_IMAGE=rancher/hardened-build-base:v1.16.7b7 FROM ${UBI_IMAGE} as ubi FROM ${GO_IMAGE} as builder # setup required packages @@ -14,18 +14,28 @@ RUN set -x \ # setup the build ARG PKG="github.com/kubernetes-incubator/metrics-server" ARG SRC="github.com/kubernetes-sigs/metrics-server" -ARG TAG="v0.3.7" +ARG TAG="v0.5.0" RUN git clone --depth=1 https://${SRC}.git $GOPATH/src/${PKG} WORKDIR $GOPATH/src/${PKG} RUN git fetch --all --tags --prune RUN git checkout tags/${TAG} -b ${TAG} -RUN GO111MODULE=off \ +RUN if echo ${TAG} | grep -qE '^v0\.3\.'; then \ + GO111MODULE=off \ go run vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go --logtostderr \ -i k8s.io/metrics/pkg/apis/metrics/v1beta1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/api/resource,k8s.io/apimachinery/pkg/version \ -p ${PKG}/pkg/generated/openapi/ \ -O zz_generated.openapi \ -h $(pwd)/hack/boilerplate.go.txt \ - -r /dev/null + -r /dev/null; \ + else \ + go install -mod=readonly k8s.io/kube-openapi/cmd/openapi-gen && \ + ${GOPATH}/bin/openapi-gen --logtostderr \ + -i k8s.io/metrics/pkg/apis/metrics/v1beta1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/api/resource,k8s.io/apimachinery/pkg/version \ + -p ${PKG}/pkg/generated/openapi/ \ + -O zz_generated.openapi \ + -h $(pwd)/scripts/boilerplate.go.txt \ + -r /dev/null; \ + fi RUN GO111MODULE=off \ GO_LDFLAGS="-linkmode=external \ -X ${PKG}/pkg/version.Version=${TAG} \ diff --git a/Makefile b/Makefile index 30cd257..daf2680 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ ORG ?= rancher # but still refers internally to github.com/kubernetes-incubator/metrics-server packages PKG ?= github.com/kubernetes-incubator/metrics-server SRC ?= github.com/kubernetes-sigs/metrics-server -TAG ?= v0.3.7$(BUILD_META) +TAG ?= v0.5.0$(BUILD_META) ifneq ($(DRONE_TAG),) TAG := $(DRONE_TAG)