From 934a06381db8d05ab2e2393920566a3470d2a66c Mon Sep 17 00:00:00 2001 From: Sean Malloy Date: Wed, 5 Jun 2019 00:35:10 -0500 Subject: [PATCH 1/3] Push Container Images To k8s.gcr.io Run below commands to build and push a staging image to staging-k8s.gcr.io. ``` $ make push ``` Run below commands to build and push a release image to k8s.gcr.io. ``` $ git checkout v0.9.0 $ VERSION=v0.9.0 REGISTRY=k8s.gcr.io make push ``` --- Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e3b2f8b1f..14e34e70d 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ .PHONY: test # VERSION is currently based on the last commit -VERSION=`git describe --tags` +VERSION?=`git describe --tags` COMMIT=`git rev-parse HEAD` BUILD=`date +%FT%T%z` LDFLAG_LOCATION=github.com/kubernetes-incubator/descheduler/cmd/descheduler/app @@ -25,9 +25,11 @@ LDFLAGS=-ldflags "-X ${LDFLAG_LOCATION}.version=${VERSION} -X ${LDFLAG_LOCATION} GOLANGCI_VERSION := v1.15.0 HAS_GOLANGCI := $(shell which golangci-lint) +# REGISTRY is the container registry to push into. +REGISTRY?=staging-k8s.gcr.io + # IMAGE is the image name of descheduler -# Should this be changed? -IMAGE:=descheduler:$(VERSION) +IMAGE:=$(REGISTRY)/descheduler:$(VERSION) all: build @@ -40,6 +42,12 @@ dev-image: build image: docker build -t $(IMAGE) . +push-container: image + gcloud auth configure-docker + docker push $(IMAGE) + +push: push-container + clean: rm -rf _output From 7094c404c99ec629b28a68a3199367c03d72986d Mon Sep 17 00:00:00 2001 From: Sean Malloy Date: Wed, 19 Jun 2019 00:51:31 -0500 Subject: [PATCH 2/3] Change push-container to push-container-to-gcloud Changes made based on code review comments. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 14e34e70d..55b536e80 100644 --- a/Makefile +++ b/Makefile @@ -42,11 +42,11 @@ dev-image: build image: docker build -t $(IMAGE) . -push-container: image +push-container-to-gcloud: image gcloud auth configure-docker docker push $(IMAGE) -push: push-container +push: push-container-to-gcloud clean: rm -rf _output From 6a08b5661aaa34b6e03d8a2b029068f607e11e12 Mon Sep 17 00:00:00 2001 From: Sean Malloy Date: Thu, 20 Jun 2019 01:00:01 -0500 Subject: [PATCH 3/3] Changes image variable name based on code review comments --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 55b536e80..8ce134904 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,10 @@ HAS_GOLANGCI := $(shell which golangci-lint) REGISTRY?=staging-k8s.gcr.io # IMAGE is the image name of descheduler -IMAGE:=$(REGISTRY)/descheduler:$(VERSION) +IMAGE:=descheduler:$(VERSION) + +# IMAGE_GCLOUD is the image name of descheduler in the remote registry +IMAGE_GCLOUD:=$(REGISTRY)/descheduler:$(VERSION) all: build @@ -44,7 +47,8 @@ image: push-container-to-gcloud: image gcloud auth configure-docker - docker push $(IMAGE) + docker tag $(IMAGE) $(IMAGE_GCLOUD) + docker push $(IMAGE_GCLOUD) push: push-container-to-gcloud