Skip to content

Commit

Permalink
Add version labels to release manifest items (#75)
Browse files Browse the repository at this point in the history
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: <git-version-gen>

If run from nnf-deploy's "make manifests" the labels will be:

  app.kubernetes.io/component: lustre-csi-driver
  app.kubernetes.io/version: <lustre-csi-driver's git-version-gen>
  app.kubernetes.io/part-of: nnf
  app.kubernetes.io/nnf-version: <nnf-deploy's git-version-gen>

Signed-off-by: Dean Roehrich <[email protected]>
  • Loading branch information
roehrich-hpe authored Jul 2, 2024
1 parent c559e76 commit c6ea338
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion hack/make-kustomization.sh
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -33,6 +33,21 @@ cat <<EOF > "$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 <<EOF >> "$OVERLAY_DIR"/kustomization.yaml
app.kubernetes.io/nnf-version: "$NNF_VERSION"
app.kubernetes.io/part-of: nnf
EOF
fi

cat <<EOF >> "$OVERLAY_DIR"/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
Expand Down

0 comments on commit c6ea338

Please sign in to comment.