Skip to content

Commit

Permalink
fix: overlay IPAM not reporting version (#2090)
Browse files Browse the repository at this point in the history
* fix overlay IPAM not reporting version

* revert file and var naming, add correct path to makefile
  • Loading branch information
nddq authored Aug 14, 2023
1 parent 2740187 commit 19e42c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ zapai-version: ## prints the zapai version

# Build the delegated IPAM plugin binary.
azure-ipam-binary:
cd $(AZURE_IPAM_DIR) && CGO_ENABLED=0 go build -v -o $(AZURE_IPAM_BUILD_DIR)/azure-ipam$(EXE_EXT) -ldflags "-X main.version=$(AZURE_IPAM_VERSION)" -gcflags="-dwarflocationlists=true"
cd $(AZURE_IPAM_DIR) && CGO_ENABLED=0 go build -v -o $(AZURE_IPAM_BUILD_DIR)/azure-ipam$(EXE_EXT) -ldflags "-X github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo.Version=$(AZURE_IPAM_VERSION)" -gcflags="-dwarflocationlists=true"

# Build the Azure CNM binary.
cnm-binary:
Expand Down
3 changes: 3 additions & 0 deletions azure-ipam/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"log"
"os"

"github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo"
"github.com/Azure/azure-container-networking/azure-ipam/logger"
cnsclient "github.com/Azure/azure-container-networking/cns/client"
"github.com/containernetworking/cni/pkg/skel"
Expand Down Expand Up @@ -48,6 +49,8 @@ func executePlugin() error {
return errors.Wrapf(err, "failed to create IPAM plugin")
}

bv.BuildVersion = buildinfo.Version

// Execute CNI plugin
cniErr := skel.PluginMainWithError(plugin.CmdAdd, plugin.CmdCheck, plugin.CmdDel, version.All, bv.BuildString(pluginName))
if cniErr != nil {
Expand Down

0 comments on commit 19e42c4

Please sign in to comment.