File tree 8 files changed +53
-14
lines changed
deployments/helm/dra-example-driver
8 files changed +53
-14
lines changed Original file line number Diff line number Diff line change 5
5
. /dra-example-kubeletplugin
6
6
7
7
driver_image.tar
8
+ * .tgz
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ $(DOCKER_TARGETS): docker-%: .build-image
154
154
make $(* )
155
155
156
156
# Start an interactive shell using the development image.
157
- PHONY : .shell
157
+ . PHONY : .shell
158
158
.shell :
159
159
$(CONTAINER_TOOL ) run \
160
160
--rm \
@@ -165,3 +165,14 @@ PHONY: .shell
165
165
$(CONTAINER_TOOL_OPTS ) \
166
166
-w $(PWD ) \
167
167
$(BUILDIMAGE )
168
+
169
+ .PHONY : push-release-artifacts
170
+ push-release-artifacts :
171
+ if echo -n " ${GIT_TAG} " | grep -q " ^chart/" ; then \
172
+ export CHART_VERSION=" $$ {GIT_TAG##chart/}" ; \
173
+ demo/scripts/push-driver-chart.sh; \
174
+ else \
175
+ export DRIVER_IMAGE_TAG=" ${GIT_TAG} " ; \
176
+ demo/scripts/build-driver-image.sh; \
177
+ demo/scripts/push-driver-image.sh; \
178
+ fi
Original file line number Diff line number Diff line change @@ -4,12 +4,10 @@ options:
4
4
machineType : E2_HIGHCPU_32
5
5
steps :
6
6
- name : gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20250116-2a05ea7e3d
7
- entrypoint : bash
7
+ entrypoint : make
8
8
env :
9
9
- DRIVER_IMAGE_REGISTRY=us-central1-docker.pkg.dev/k8s-staging-images/dra-example-driver
10
- - DRIVER_IMAGE_TAG=$_GIT_TAG # _GIT_TAG is injected by Prow
10
+ - DRIVER_CHART_REGISTRY=us-central1-docker.pkg.dev/k8s-staging-images/charts
11
+ - GIT_TAG=$_GIT_TAG # _GIT_TAG is injected by the image builder running in Prow
11
12
args :
12
- - -ec
13
- - |
14
- demo/scripts/build-driver-image.sh
15
- demo/scripts/push-driver-image.sh
13
+ - push-release-artifacts
Original file line number Diff line number Diff line change @@ -26,9 +26,9 @@ SCRIPTS_DIR="$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)"
26
26
: ${DRIVER_NAME:= dra-example-driver}
27
27
28
28
# The registry, image and tag for the example driver
29
- : ${DRIVER_IMAGE_REGISTRY:= " registry.example.com " }
29
+ : ${DRIVER_IMAGE_REGISTRY:= " registry.k8s.io " }
30
30
: ${DRIVER_IMAGE_NAME:= " ${DRIVER_NAME} " }
31
- : ${DRIVER_IMAGE_TAG:= " v0.1.0 " }
31
+ : ${DRIVER_IMAGE_TAG:= " $( helm show chart $( git rev-parse --show-toplevel ) /deployments/helm/ ${DRIVER_NAME} | sed -n ' s/^appVersion: //p ' ) " }
32
32
: ${DRIVER_IMAGE_PLATFORM:= " ubuntu22.04" }
33
33
34
34
# The kubernetes repo to build the kind cluster from
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # Copyright 2025 The Kubernetes Authors.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # A reference to the current directory where this script is located
18
+ CURRENT_DIR=" $( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd) "
19
+
20
+ set -ex
21
+ set -o pipefail
22
+
23
+ source " ${CURRENT_DIR} /common.sh"
24
+
25
+ # Set build variables
26
+ export REGISTRY=" ${DRIVER_CHART_REGISTRY} "
27
+ export CHART_NAME=" ${DRIVER_NAME} "
28
+
29
+ helm package --version " ${CHART_VERSION} " deployments/helm/dra-example-driver
30
+ helm push " ${CHART_NAME} -${CHART_VERSION} .tgz" " oci://${REGISTRY} "
Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ type: application
15
15
# This is the chart version. This version number should be incremented each time you make changes
16
16
# to the chart and its templates, including the app version.
17
17
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18
- version : 0.1.0
18
+ version : 0.0.0-dev
19
19
20
20
# This is the version number of the application being deployed. This version number should be
21
21
# incremented each time you make changes to the application. Versions are not expected to
22
22
# follow Semantic Versioning. They should reflect the version the application is using.
23
23
# It is recommended to use it with quotes.
24
- appVersion : " 0 .1.0"
24
+ appVersion : " v0 .1.0"
Original file line number Diff line number Diff line change @@ -80,8 +80,7 @@ Selector labels
80
80
Full image name with tag
81
81
*/} }
82
82
{ {- define " dra-example-driver.fullimage" -} }
83
- { {- $tag := printf " v%s" .Chart.AppVersion } }
84
- { {- .Values.image.repository -} }:{ {- .Values.image.tag | default $tag -} }
83
+ { {- .Values.image.repository -} }:{ {- .Values.image.tag | default .Chart.AppVersion -} }
85
84
{ {- end } }
86
85
87
86
{ {/*
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ allowDefaultNamespace: false
11
11
12
12
imagePullSecrets : []
13
13
image :
14
- repository : registry.example.com /dra-example-driver
14
+ repository : registry.k8s.io /dra-example-driver
15
15
pullPolicy : IfNotPresent
16
16
# Overrides the image tag whose default is the chart appVersion.
17
17
tag : " "
You can’t perform that action at this time.
0 commit comments