Skip to content

Commit bfb599a

Browse files
authored
use latest tag to fetch controller image (#79)
resolves Issue: #74 instead of pinning to a fix version, use latest tag to fetch the correct image and that should also update in workflow --------- Signed-off-by: ankittk <ankit.kumar@getweave.com>
1 parent 8e4a975 commit bfb599a

6 files changed

Lines changed: 19 additions & 9 deletions

File tree

.github/workflows/tag.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ jobs:
5151
fi
5252
echo "Building Docker image with version: ${VERSION}"
5353
make docker-build VERSION=${VERSION}
54+
55+
# Also tag and push as 'latest'
56+
echo "Tagging and pushing as 'latest'..."
57+
make docker-tag-latest VERSION=${VERSION}
5458
push-helm-chart:
5559
needs:
5660
- push-images

Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,12 @@ helm-package: manifests
8585
mkdir -p $(DIST_FOLDER)
8686
@echo "Packaging Helm chart with version $(VERSION)..."
8787
@cp helm/kmcp/Chart.yaml helm/kmcp/Chart.yaml.bak
88-
@sed "s/^version: .*/version: $(VERSION)/" helm/kmcp/Chart.yaml.bak > helm/kmcp/Chart.yaml
88+
@awk '/^version:/ { print; print "appVersion: \"$(VERSION)\""; next } { print }' helm/kmcp/Chart.yaml.bak > helm/kmcp/Chart.yaml
8989
@helm package helm/kmcp --version $(VERSION) -d $(DIST_FOLDER)
9090
@mv helm/kmcp/Chart.yaml.bak helm/kmcp/Chart.yaml
9191
@echo "Helm package created: $(DIST_FOLDER)/kmcp-$(VERSION).tgz"
9292
@cp config/crd/bases/kagent.dev_mcpservers.yaml helm/kmcp-crds/templates/mcpserver-crd.yaml
93-
@cp helm/kmcp-crds/Chart.yaml helm/kmcp-crds/Chart.yaml.bak
94-
@sed "s/^version: .*/version: $(VERSION)/" helm/kmcp-crds/Chart.yaml.bak > helm/kmcp-crds/Chart.yaml
9593
@helm package helm/kmcp-crds --version $(VERSION) -d $(DIST_FOLDER)
96-
@mv helm/kmcp-crds/Chart.yaml.bak helm/kmcp-crds/Chart.yaml
9794
@echo "Helm package created: $(DIST_FOLDER)/kmcp-crds-$(VERSION).tgz"
9895

9996
.PHONY: helm-cleanup
@@ -240,6 +237,14 @@ docker-build: ## Build docker image with the manager.
240237
$(DOCKER_BUILDER) build $(DOCKER_BUILD_ARGS) -t ${CONTROLLER_IMG} .
241238
- $(DOCKER_BUILDER) rm $(BUILDX_BUILDER_NAME)
242239

240+
.PHONY: docker-tag-latest
241+
docker-tag-latest: ## Tag the built image as 'latest' and push it
242+
@echo "Tagging image as 'latest'..."
243+
@docker tag ${CONTROLLER_IMG} $(DOCKER_REGISTRY)/$(DOCKER_REPO)/$(CONTROLLER_IMAGE_NAME):latest
244+
@echo "Pushing 'latest' tag..."
245+
@docker push $(DOCKER_REGISTRY)/$(DOCKER_REPO)/$(CONTROLLER_IMAGE_NAME):latest
246+
@echo "Latest tag pushed successfully"
247+
243248
.PHONY: docker-push
244249
docker-push: ## Push docker image with the manager.
245250
$(DOCKER_BUILDER) push ${CONTROLLER_IMG}

helm/kmcp-crds/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: kmcp-crds
33
description: CRDs for KMCP (Kubernetes MCP Server Controller)
44
type: application
5-
version: 0.1.0
5+
version: 1.0.0
66
home: https://github.com/kagent-dev/kmcp
77
sources:
88
- https://github.com/kagent-dev/kmcp

helm/kmcp/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: kmcp
33
description: A Helm chart for KMCP (Kubernetes MCP Server Controller)
44
type: application
5-
version: 0.1.0
5+
version: 1.0.0
66
home: https://github.com/kagent-dev/kmcp
77
sources:
88
- https://github.com/kagent-dev/kmcp

helm/kmcp/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Allows overriding it for multi-namespace deployments in combined charts.
6565
Create the image reference
6666
*/}}
6767
{{- define "kmcp.image" -}}
68-
{{- $tag := .Values.image.tag | default .Chart.Version }}
68+
{{- $tag := .Values.image.tag | default .Chart.AppVersion | default "latest" }}
6969
{{- printf "%s:%s" .Values.image.repository $tag }}
7070
{{- end }}
7171

helm/kmcp/values.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ namespaceOverride: ""
1313
image:
1414
repository: ghcr.io/kagent-dev/kmcp/controller
1515
pullPolicy: IfNotPresent
16-
# Overrides the image tag whose default is the chart appVersion.
17-
tag: "v0.1.0"
16+
# Overrides the image tag whose default is the chart's appVersion.
17+
# Set to a specific version (e.g., "v0.1.7") to pin to that version.
18+
# tag: ""
1819

1920
# Image pull secrets for private registries
2021
imagePullSecrets: []

0 commit comments

Comments
 (0)