Skip to content

Commit f750f16

Browse files
committed
comments, revert a var rename for smaller diff
1 parent 0ce1f51 commit f750f16

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

Makefile

+11-11
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ TAR_EXT := tar.bz2
1919
export NETPLUGIN_CONTAINER_TAG := $(shell ./scripts/getGitVersion.sh)
2020
TAR_FILENAME := $(NAME)-$(VERSION).$(TAR_EXT)
2121
TAR_LOC := .
22-
export NETPLUGIN_TAR_FILE := $(TAR_LOC)/$(TAR_FILENAME)
22+
export TAR_FILE := $(TAR_LOC)/$(TAR_FILENAME)
2323
export V2PLUGIN_TAR_FILENAME := v2plugin-$(VERSION).tar.gz
2424
GO_MIN_VERSION := 1.7
2525
GO_MAX_VERSION := 1.8
@@ -302,19 +302,24 @@ host-plugin-create:
302302
docker plugin create ${CONTIV_V2PLUGIN_NAME} install/v2plugin
303303
docker plugin enable ${CONTIV_V2PLUGIN_NAME}
304304

305-
# re-deploy the v2plugin in docker with latest versioned binaries
305+
# Note: only updates a single host
306+
# shortcut for an existing v2plugin cluster to update the netplugin
307+
# binaries, recommended uses:
308+
# 'make node1-make-targets=host-plugin-update tar make-on-node1-dep'
309+
# on the VM: 'make compile archive host-plugin-update'
306310
host-plugin-update: host-plugin-remove unarchive host-plugin-create
307311
rm -rf install/v2plugin/rootfs
308312

309313
# cleanup all containers, recreate and start the v2plugin on all hosts
310-
# uses the latest compile binaries
314+
# uses the latest compiled binaries
311315
host-plugin-restart: unarchive
312316
@echo dev: restarting services...
313317
cd $(GOPATH)/src/github.com/contiv/netplugin/scripts/python \
314318
&& PYTHONIOENCODING=utf-8 ./startPlugin.py -nodes ${CLUSTER_NODE_IPS} \
315319
-plugintype "v2plugin"
316320

317321
# unpack v2plugin archive created by host-pluginfs-create
322+
# Note: do not unpack locally to share with VM, unpack on the target machine
318323
host-pluginfs-unpack:
319324
# clear out old plugin completely
320325
sudo rm -rf install/v2plugin/rootfs
@@ -361,14 +366,9 @@ host-plugin-release: tar host-pluginfs-create host-pluginfs-unpack host-plugin-c
361366
docker plugin push ${CONTIV_V2PLUGIN_NAME}
362367

363368
# unarchive versioned binaries to bin, usually as a helper for other targets
364-
# uses the version stored in file 'netplugin-version' which is produced anytime
365-
# binaries are compiled (and that version can be set with env var
366-
# 'BUILD_VERSION'
367369
unarchive:
368-
@# $(NETPLUGIN_TAR_FILE) depends on local file netplugin-version (exists in image),
369-
@# but it is evaluated after we have extracted that file to local disk
370370
@echo Updating bin/ with binaries versioned $(VERSION)
371-
tar -xf $(NETPLUGIN_TAR_FILE) -C bin
371+
tar -xf $(TAR_FILE) -C bin
372372

373373
# pulls netplugin binaries from build container
374374
binaries-from-container:
@@ -386,7 +386,7 @@ binaries-from-container:
386386
archive:
387387
$(TAR) --version | grep -q GNU \
388388
|| (echo Please use GNU tar as \'gtar\' or \'tar\'; exit 1)
389-
$(TAR) --owner=0 --group=0 -jcf $(NETPLUGIN_TAR_FILE) \
389+
$(TAR) --owner=0 --group=0 -jcf $(TAR_FILE) \
390390
-C bin netplugin netmaster netctl contivk8s netcontiv \
391391
-C ../scripts contrib/completion/bash/netctl get-contiv-diags
392392

@@ -399,7 +399,7 @@ clean-tar:
399399

400400
# do not run directly, use "release" target
401401
release-built-version: tar
402-
TAR_FILENAME=$(TAR_FILENAME) TAR_FILE=$(NETPLUGIN_TAR_FILE) OLD_VERSION=${OLD_VERSION} \
402+
TAR_FILENAME=$(TAR_FILENAME) TAR_FILE=$(TAR_FILE) OLD_VERSION=${OLD_VERSION} \
403403
NIGHTLY_RELEASE=${NIGHTLY_RELEASE} scripts/release.sh
404404
@make clean-tar
405405

scripts/v2plugin_rootfs.sh

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
# Script to create the docker v2 plugin
44
# run this script from contiv/netplugin directory
5+
56
# requires NETPLUGIN_CONTAINER_TAG for contivrootfs image
6-
# requires CONTIV_NETPLUGIN_NAME, the Network Driver name for requests to
7+
# requires CONTIV_V2PLUGIN_NAME, the Network Driver name for requests to
78
# dockerd, should look like contiv/v2plugin:$NETPLUGIN_CONTAINER_TAG
8-
# requires NETPLUGIN_TAR_FILE to point to the netplugin binaries
9+
# requires TAR_FILE to point to the netplugin binaries
10+
# requires V2PLUGIN_TAR_FILENAME to point to the v2plugin archive
911

1012
set -euxo pipefail
1113

@@ -18,13 +20,13 @@ sed '/##/d;s/__CONTIV_V2PLUGIN_NAME__/${CONTIV_V2PLUGIN_NAME}/' \
1820
install/v2plugin/config.template > install/v2plugin/config.json
1921

2022
# copy over binaries
21-
cp ${NETPLUGIN_TAR_FILE} install/v2plugin/
23+
cp ${TAR_FILE} install/v2plugin/
2224

2325
DOCKER_IMAGE=contivrootfs:${NETPLUGIN_CONTAINER_TAG}
2426
docker build -t ${DOCKER_IMAGE} \
25-
--build-arg TAR_FILE=$(basename "${NETPLUGIN_TAR_FILE}") install/v2plugin
27+
--build-arg TAR_FILE=$(basename "${TAR_FILE}") install/v2plugin
2628

27-
rm install/v2plugin/${NETPLUGIN_TAR_FILE}
29+
rm install/v2plugin/${TAR_FILE}
2830

2931
# creates a ready to run container but doesn't run it
3032
id=$(docker create $DOCKER_IMAGE true)

0 commit comments

Comments
 (0)