Backport of fix version output for consul-cni
into release/1.4.x
#3832
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.
Backport
This PR is auto-generated from #3829 to be assessed for backporting due to the inclusion of the label backport/1.4.x.
The below text is copied from the body of the original PR.
The
consul-cni
plugin emits "version unknown" because the CNI library'sPluginMain
uses a global variable that isn't being set as part of our build process. Import thecontrol-plane/version
package so that we have an identical version in builds across both binaries.How I've tested this PR
Before:
After:
How I expect reviewers to test this PR
As above
Checklist
Tests addedn/aNote for reviewers: an alternative approach I considered was to "vendor" the
control-plane/version
package into theconsul-cni
plugin. This seems to work but doesn't make a different in binary size, and makes for a second place folks would need to update in releases, so I opted for an import. The nice thing about this (maybe?) is that it also keeps the indirect dependencies up-to-date inconsul-cni
. Happy to change approaches here though, if you'd like.Nomad fingerprints CNI binary versions to ensure that the node we place workloads onto can actually support the requested networking configuration, so we'll need to this for Nomad's transparent proxy support hashicorp/nomad#10628
Overview of commits