Skip to content

Commit 1c14dd0

Browse files
author
Yongli Chen
authored
make archive for npm (#200)
1 parent 6a0f9ff commit 1c14dd0

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ CNM_ARCHIVE_NAME = azure-vnet-cnm-$(GOOS)-$(GOARCH)-$(VERSION).$(ARCHIVE_EXT)
8888
CNI_ARCHIVE_NAME = azure-vnet-cni-$(GOOS)-$(GOARCH)-$(VERSION).$(ARCHIVE_EXT)
8989
CNI_MULTITENANCY_ARCHIVE_NAME = azure-vnet-cni-multitenancy-$(GOOS)-$(GOARCH)-$(VERSION).$(ARCHIVE_EXT)
9090
CNS_ARCHIVE_NAME = azure-cns-$(GOOS)-$(GOARCH)-$(VERSION).$(ARCHIVE_EXT)
91+
NPM_ARCHIVE_NAME = azure-npm-$(GOOS)-$(GOARCH)-$(VERSION).$(ARCHIVE_EXT)
9192

9293
# Docker libnetwork (CNM) plugin v2 image parameters.
9394
CNM_PLUGIN_IMAGE ?= microsoft/azure-vnet-plugin
@@ -107,7 +108,7 @@ azure-vnet: $(CNI_BUILD_DIR)/azure-vnet$(EXE_EXT)
107108
azure-vnet-ipam: $(CNI_BUILD_DIR)/azure-vnet-ipam$(EXE_EXT)
108109
azure-cni-plugin: azure-vnet azure-vnet-ipam cni-archive
109110
azure-cns: $(CNS_BUILD_DIR)/azure-cns$(EXE_EXT) cns-archive
110-
azure-npm: $(NPM_BUILD_DIR)/azure-npm
111+
azure-npm: $(NPM_BUILD_DIR)/azure-npm$(EXE_EXT) npm-archive
111112

112113
all-binaries: azure-cnm-plugin azure-cni-plugin azure-cns azure-npm
113114

@@ -232,4 +233,14 @@ cnm-archive:
232233
cns-archive:
233234
chmod 0755 $(CNS_BUILD_DIR)/azure-cns$(EXE_EXT)
234235
cd $(CNS_BUILD_DIR) && $(ARCHIVE_CMD) $(CNS_ARCHIVE_NAME) azure-cns$(EXE_EXT)
235-
chown $(BUILD_USER):$(BUILD_USER) $(CNS_BUILD_DIR)/$(CNS_ARCHIVE_NAME)
236+
chown $(BUILD_USER):$(BUILD_USER) $(CNS_BUILD_DIR)/$(CNS_ARCHIVE_NAME)
237+
238+
# Create a NPM archive for the target platform.
239+
.PHONY: npm-archive
240+
npm-archive:
241+
ifeq ($(GOOS),linux)
242+
# Azure-NPM only supports Linux for now.
243+
chmod 0755 $(NPM_BUILD_DIR)/azure-npm$(EXE_EXT)
244+
cd $(NPM_BUILD_DIR) && $(ARCHIVE_CMD) $(NPM_ARCHIVE_NAME) azure-npm$(EXE_EXT)
245+
chown $(BUILD_USER):$(BUILD_USER) $(NPM_BUILD_DIR)/$(NPM_ARCHIVE_NAME)
246+
endif

cni/network/plugin/main.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,14 @@ func reportPluginError(reportManager *telemetry.CNIReportManager, err error) {
5050

5151
// Main is the entry point for CNI network plugin.
5252
func main() {
53-
var config common.PluginConfig
54-
var err error
53+
var (
54+
config common.PluginConfig
55+
err error
56+
)
57+
5558
config.Version = version
5659
reportManager := &telemetry.CNIReportManager{
57-
ReportMangager: &telemetry.ReportManager{
60+
ReportManager: &telemetry.ReportManager{
5861
HostNetAgentURL: hostNetAgentURL,
5962
ReportType: reportType,
6063
},

telemetry/telemetry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ type NPMReport struct {
105105
ClusterState ClusterState
106106
}
107107

108-
// ReportManager interface.
108+
// ReportManager structure.
109109
type ReportManager struct {
110110
HostNetAgentURL string
111111
ReportType string

0 commit comments

Comments
 (0)