fix: piped plugins display correct version information #6308
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.
What this PR does
This PR fixes an issue where piped plugins were showing "unspecified" for version, git commit, and build date information when running the
versioncommand.Problem
Currently, when downloading and running a plugin binary, the version command shows:
This happened because the plugin build process in the Makefile was not setting the necessary ldflags to inject version information during compilation.
Solution
Modified the build/plugin target in the Makefile to include version ldflags similar to how the main build/go target works. The changes add:
->
BUILD_VERSION,BUILD_COMMIT,BUILD_DATEvariables->
BUILD_LDFLAGS_PREFIXfor the version package-> Updated
BUILD_OPTSto include ldflags that inject version informationAfter the fix
Now plugin binaries will correctly display version information:
Testing
-> Built the wait plugin locally and verified the version command now shows proper information.
-> The fix maintains consistency with how main PipeCD binaries are built.
Related Issues
Fixes #6306
Changes Made
ldflagsto thebuild/plugintarget to inject version, git commit, and build date information during plugin compilation.Note: Existing plugin binaries remain unaffected; only new builds include version info.