Fix plugin version showing unspecified #6307
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Downloaded plugin binaries currently show unspecified version information:
This makes it impossible to verify which version of a plugin is deployed.
Root Cause
The plugin_release workflow wasn't passing version information when building plugins, and the Makefile's build/plugin target didn't inject version details via ldflags like the build/go target does.
Changes
1 - Updated Makefile
Modified the build/plugin target to inject version/commit/buildDate via ldflags, using the same pattern as build/go:
Added BUILD_VERSION, BUILD_COMMIT, BUILD_DATE variables
Updated BUILD_OPTS to include version ldflags
2 - Updated workflow
Modified .github/workflows/plugin_release.yaml to pass BUILD_VERSION=${{ inputs.version }} to all plugin build commands (all 4 platform targets)
Test
Verified the fix works locally:
Also tested with the kubernetes plugin to confirm the fix works generically across all plugins:
fixes #6306