Skip to content

Conversation

@elezar
Copy link
Member

@elezar elezar commented Mar 12, 2025

This change removes the v prefix from the Helm chart appVersion. The prefix is prepended in the template helpers if required.

This aligns this project with other projects such as the device plugin.

@elezar elezar added this to the v25.3.0 milestone Mar 12, 2025
@jgehrcke
Copy link
Collaborator

jgehrcke commented Mar 12, 2025

Ha. On #277 (comment) I wrote:

(for example, appVersion could also not be v-prefixed and then we could add the v in the calculation, to just name one of many different methods).

So.. you're saying we already do this:

The prefix is prepended in the template helpers if required

OK. Where is that logic?

And while answering this question we found that it's not there:

{{- define "nvidia-dra-driver-gpu.fullimage" -}}

Was removed here:
2956dba

Edit: Only now I look at the patch and see that you have re-added that logic here. Ha! :)

# Note(JP): this currently defines the default `tag` value in a k8s
# image specification, and therefore must currently be v-prefixed.
appVersion: "v25.3.0-rc.1"
# image specification. A "v" is prefixed in our template helpers to ensure constency.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"consistency".

can do after merge.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change the comment to say:

This is used to construct the default tag value for the k8s
image specification (with a "v" is prefixed to this value), see
_helpers.tpl.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done now since we have the issue below.

else
VERSION=$1
fi
# Remove any v prefix, if exists.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But.. the code below is broken. :)

 VERSION="${VERSION#v}"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦

Updated.

@elezar elezar force-pushed the make-app-version-consistent branch from e6470e3 to ce0b144 Compare March 12, 2025 10:20
Copy link
Collaborator

@jgehrcke jgehrcke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To add to the v-prefix frustration: the "Remove any v prefix, if exists" logic must again be amended in the current patch.

This change removes the v prefix from the Helm chart appVersion.
The prefix is prepended in the template helpers if required.

This aligns this project with other projects such as the device plugin.

Signed-off-by: Evan Lezar <[email protected]>
@elezar elezar force-pushed the make-app-version-consistent branch from ce0b144 to 91555a9 Compare March 12, 2025 10:21
Copy link
Collaborator

@jgehrcke jgehrcke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

No more v prefixes for me for 10 years. Hello!

if [ -z "$1" ]; then
VERSION=$(awk -F= '/^VERSION/ { print $2 }' versions.mk | tr -d '[:space:]')
# Remove any v prefix, if exists.
VERSION="${VERSION#v}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, all of this is a great example that (well-maintained) code comments easily can save a bunch of time overall.

*/}}
{{- define "nvidia-dra-driver-gpu.fullimage" -}}
{{- $tag := printf "%s" .Chart.AppVersion }}
{{- $tag := printf "v%s" .Chart.AppVersion }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future we should add a code comment here, too, if the template language allows for that.

@jgehrcke jgehrcke merged commit 48d6390 into NVIDIA:main Mar 12, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants