Skip to content

Commit 37a5f01

Browse files
committed
fix: use the correct version format
The Kubernetes `k8s.io/component-base/version` package requires the `gitVersion` variable to be valid `vX.Y.Z` SemVer.
1 parent 3357e13 commit 37a5f01

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION ?= 0.1.0-$(GIT_COMMIT_SHORT)
1+
VERSION ?= v0.1.0
22
GO_CONTAINER_IMAGE ?= docker.io/golang:1.25.3
33

44
CONTAINER_RUNTIME ?= $(shell command -v podman 2>/dev/null || command -v docker 2>/dev/null)
@@ -11,7 +11,7 @@ GIT_COMMIT_SHORT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "unkn
1111
# Container image configuration.
1212
IMAGE_REGISTRY ?= ghcr.io/oxidecomputer
1313
IMAGE_NAME ?= oxide-cloud-controller-manager
14-
IMAGE_TAG ?= $(VERSION)
14+
IMAGE_TAG ?= $(patsubst v%,%,$(VERSION))-$(GIT_COMMIT_SHORT)
1515
IMAGE_FULL ?= $(if $(IMAGE_REGISTRY),$(IMAGE_REGISTRY)/)$(IMAGE_NAME):$(IMAGE_TAG)
1616

1717
.PHONY: test
@@ -25,17 +25,17 @@ test:
2525
.
2626
$(CONTAINER_RUNTIME) run --rm $(IMAGE_NAME)-builder:$(IMAGE_TAG) go test -v ./...
2727

28-
.PHONY: image-build
29-
image-build:
28+
.PHONY: build
29+
build:
3030
@echo "Building container image: $(IMAGE_FULL)"
3131
$(CONTAINER_RUNTIME) build \
3232
--build-arg GO_CONTAINER_IMAGE=$(GO_CONTAINER_IMAGE) \
3333
--build-arg VERSION=$(VERSION) \
3434
-t $(IMAGE_FULL) \
3535
.
3636

37-
.PHONY: image-push
38-
image-push:
37+
.PHONY: push
38+
push:
3939
@if [ -z "$(IMAGE_REGISTRY)" ]; then \
4040
echo "Error: IMAGE_REGISTRY must be set to push images"; \
4141
echo "Example: make image-push IMAGE_REGISTRY=ghcr.io/oxidecomputer"; \

0 commit comments

Comments
 (0)