From c6ea3383b60730a4f914f0f126cc19bc61fb69f9 Mon Sep 17 00:00:00 2001 From: Dean Roehrich Date: Tue, 2 Jul 2024 13:04:18 -0500 Subject: [PATCH 1/4] Add version labels to release manifest items (#75) Add component/version labels to each resource in the manifest. If run locally the labels will be: app.kubernetes.io/component: lustre-csi-driver app.kubernetes.io/version: If run from nnf-deploy's "make manifests" the labels will be: app.kubernetes.io/component: lustre-csi-driver app.kubernetes.io/version: app.kubernetes.io/part-of: nnf app.kubernetes.io/nnf-version: Signed-off-by: Dean Roehrich --- hack/make-kustomization.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/hack/make-kustomization.sh b/hack/make-kustomization.sh index 78034df..56cd3a3 100755 --- a/hack/make-kustomization.sh +++ b/hack/make-kustomization.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2023 Hewlett Packard Enterprise Development LP +# Copyright 2023-2024 Hewlett Packard Enterprise Development LP # Other additional copyright holders may be indicated within. # # The entirety of this work is licensed under the Apache License, @@ -33,6 +33,21 @@ cat < "$OVERLAY_DIR"/kustomization.yaml resources: - ../$OVERLAY +commonLabels: + app.kubernetes.io/version: "$TAG" + app.kubernetes.io/component: lustre-csi-driver +EOF + +if [[ -n $NNF_VERSION ]] +then + cat <> "$OVERLAY_DIR"/kustomization.yaml + app.kubernetes.io/nnf-version: "$NNF_VERSION" + app.kubernetes.io/part-of: nnf +EOF +fi + +cat <> "$OVERLAY_DIR"/kustomization.yaml + apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization images: From 35fd221c2a34ea32419b1eef5424ae5d3bb0e39f Mon Sep 17 00:00:00 2001 From: Dean Roehrich Date: Wed, 3 Jul 2024 09:44:59 -0500 Subject: [PATCH 2/4] Specify Go 1.21 in go.mod and Dockerfile (#76) Signed-off-by: Dean Roehrich --- Dockerfile | 22 ++++++++++++++++++++-- go.mod | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3b4b87c..c156417 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,23 @@ +# +# Copyright 2021-2024 Hewlett Packard Enterprise Development LP +# Other additional copyright holders may be indicated within. +# +# The entirety of this work is licensed under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Builder stage for compiling go source code -FROM golang:1.19 as builder +FROM golang:1.21 as builder WORKDIR /workspace @@ -31,4 +49,4 @@ COPY --from=builder /workspace/lustre-csi-driver . # See mount.lustre description in sbin/README.md COPY sbin/mount.lustre-cray /sbin/mount.lustre -ENTRYPOINT ["/lustre-csi-driver"] \ No newline at end of file +ENTRYPOINT ["/lustre-csi-driver"] diff --git a/go.mod b/go.mod index c4e7a3e..1b176ca 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/HewlettPackard/lustre-csi-driver -go 1.19 +go 1.21 require ( github.com/container-storage-interface/spec v1.5.0 From 977ac7e22aba63f9398e395df9058a8565c1e3f5 Mon Sep 17 00:00:00 2001 From: Dean Roehrich Date: Mon, 8 Jul 2024 11:19:00 -0500 Subject: [PATCH 3/4] Add version labels to release manifest Deployment/DaemonSet (#77) Change make-kustomization.sh to add component/version labels only to Deployment/Daemonset in the manifest. By doing only these resources, rather than all resources, we minimize the noise in a manifest update to the gitops repo. If run locally the labels will be: app.kubernetes.io/component: lustre-csi-driver app.kubernetes.io/version: If run from nnf-deploy's "make manifests" the labels will be: app.kubernetes.io/component: lustre-csi-driver app.kubernetes.io/version: app.kubernetes.io/part-of: nnf app.kubernetes.io/nnf-version: Signed-off-by: Dean Roehrich --- hack/make-kustomization.sh | 45 +++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/hack/make-kustomization.sh b/hack/make-kustomization.sh index 56cd3a3..362a298 100755 --- a/hack/make-kustomization.sh +++ b/hack/make-kustomization.sh @@ -29,24 +29,43 @@ then mkdir "$OVERLAY_DIR" fi -cat < "$OVERLAY_DIR"/kustomization.yaml -resources: -- ../$OVERLAY - -commonLabels: - app.kubernetes.io/version: "$TAG" - app.kubernetes.io/component: lustre-csi-driver -EOF +COMPONENT_LABELS=" + - op: add + path: /metadata/labels/app.kubernetes.io~1version + value: "$TAG" + - op: add + path: /metadata/labels/app.kubernetes.io~1component + value: lustre-csi-driver +" +NNF_VER_LABELS="" if [[ -n $NNF_VERSION ]] then - cat <> "$OVERLAY_DIR"/kustomization.yaml - app.kubernetes.io/nnf-version: "$NNF_VERSION" - app.kubernetes.io/part-of: nnf -EOF + NNF_VER_LABELS=" + - op: add + path: /metadata/labels/app.kubernetes.io~1nnf-version + value: "$NNF_VERSION" + - op: add + path: /metadata/labels/app.kubernetes.io~1part-of + value: nnf +" fi -cat <> "$OVERLAY_DIR"/kustomization.yaml +cat < "$OVERLAY_DIR"/kustomization.yaml +resources: +- ../$OVERLAY + +patches: +- target: + kind: Deployment + patch: |- +$COMPONENT_LABELS +$NNF_VER_LABELS +- target: + kind: DaemonSet + patch: |- +$COMPONENT_LABELS +$NNF_VER_LABELS apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization From 97e3d884a316fe3815c489b02cfc9a51ecf6d648 Mon Sep 17 00:00:00 2001 From: Blake Devcich Date: Tue, 16 Jul 2024 11:35:39 -0500 Subject: [PATCH 4/4] Update own release references Signed-off-by: Blake Devcich --- charts/lustre-csi-driver/values.yaml | 2 +- deploy/kubernetes/base/kustomization.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/lustre-csi-driver/values.yaml b/charts/lustre-csi-driver/values.yaml index 0ae5183..6caf456 100644 --- a/charts/lustre-csi-driver/values.yaml +++ b/charts/lustre-csi-driver/values.yaml @@ -4,4 +4,4 @@ deployment: image: "ghcr.io/hewlettpackard/lustre-csi-driver" - tag: "0.1.1" + tag: "0.1.2" diff --git a/deploy/kubernetes/base/kustomization.yaml b/deploy/kubernetes/base/kustomization.yaml index 25e3829..a99ae0c 100644 --- a/deploy/kubernetes/base/kustomization.yaml +++ b/deploy/kubernetes/base/kustomization.yaml @@ -13,4 +13,4 @@ resources: images: - name: controller newName: ghcr.io/hewlettpackard/lustre-csi-driver - newTag: 0.1.1 + newTag: 0.1.2