Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add version labels to release manifest Deployment/DaemonSet #77

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 32 additions & 13 deletions hack/make-kustomization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,43 @@ then
mkdir "$OVERLAY_DIR"
fi

cat <<EOF > "$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 <<EOF >> "$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 <<EOF >> "$OVERLAY_DIR"/kustomization.yaml
cat <<EOF > "$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
Expand Down
Loading