diff --git a/admission-webhook/Makefile b/admission-webhook/Makefile index 373e022a..532eb897 100644 --- a/admission-webhook/Makefile +++ b/admission-webhook/Makefile @@ -4,8 +4,9 @@ SHELL := /bin/bash WEBHOOK_ROOT := $(CURDIR) DEV_IMAGE_NAME = k8s-windows-gmsa-webhook-dev -# FIXME: find a better way to distribute/publish this image -IMAGE_NAME = wk88/k8s-gmsa-webhook:latest +VERSION = $(shell git describe --tags --always `git rev-parse HEAD`) +IMAGE_REPO = sigwindowstools/k8s-gmsa-webhook +IMAGE_NAME = $(IMAGE_REPO):$(VERSION) CURL = $(shell which curl 2> /dev/null) WGET = $(shell which wget 2> /dev/null) diff --git a/admission-webhook/deploy/deploy-gmsa-webhook.sh b/admission-webhook/deploy/deploy-gmsa-webhook.sh index 7239e9ee..20eb3915 100755 --- a/admission-webhook/deploy/deploy-gmsa-webhook.sh +++ b/admission-webhook/deploy/deploy-gmsa-webhook.sh @@ -22,7 +22,7 @@ usage: $0 --file MANIFESTS_FILE [--name NAME] [--namespace NAMESPACE] [--image I MANIFESTS_FILE is the path to the file the k8s manifests will be written to. NAME defaults to 'gmsa-webhook' and is used in the names of most of the k8s resources created. NAMESPACE is the namespace to deploy to; defaults to 'gmsa-webhook'. -IMAGE_NAME is the name of the Docker image containing the webhook; defaults to 'wk88/k8s-gmsa-webhook:latest' (FIXME: figure out a better way to distribute this image) +IMAGE_NAME is the name of the Docker image containing the webhook; defaults to 'sigwindowstools/k8s-gmsa-webhook:latest' CERTS_DIR defaults to 'gmsa-webhook-certs' If --dry-run is set, the script echoes what command it would perform @@ -82,7 +82,7 @@ main() { local MANIFESTS_FILE= local NAME='gmsa-webhook' local NAMESPACE='gmsa-webhook' - local IMAGE_NAME='wk88/k8s-gmsa-webhook:latest' + local IMAGE_NAME='sigwindowstools/k8s-gmsa-webhook:latest' local CERTS_DIR='gmsa-webhook-certs' local DRY_RUN=false local OVERWRITE=false diff --git a/admission-webhook/make/image.mk b/admission-webhook/make/image.mk index 4db8a687..1c2117a4 100644 --- a/admission-webhook/make/image.mk +++ b/admission-webhook/make/image.mk @@ -1,6 +1,5 @@ # must stay consistent with the go version defined in .travis.yml GO_VERSION = 1.16 -VERSION = $(shell git rev-parse HEAD) DOCKER_BUILD = docker build . --build-arg GO_VERSION=$(GO_VERSION) --build-arg VERSION=$(VERSION) .PHONY: image_build_dev @@ -10,7 +9,9 @@ image_build_dev: .PHONY: image_build image_build: $(DOCKER_BUILD) -f dockerfiles/Dockerfile -t $(IMAGE_NAME) + docker tag $(IMAGE_NAME) $(IMAGE_REPO):latest .PHONY: image_push image_push: docker push $(IMAGE_NAME) + docker push $(IMAGE_REPO):latest