Skip to content

Commit

Permalink
Merge pull request #900 from ozdanborne/calicoVersion
Browse files Browse the repository at this point in the history
Calico version
  • Loading branch information
caseydavenport authored Jul 19, 2017
2 parents d304ed2 + 0ca76b8 commit 43b069c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions calico_node/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ TEST_CONTAINER_FILES=$(shell find tests/ -type f ! -name '*.created')
CALICO_BUILD?=calico/go-build:$(GO_BUILD_VER)
LOCAL_USER_ID?=$(shell id -u $$USER)

LDFLAGS=-ldflags "-X main.VERSION=$(CALICO_GIT_VER)"

PACKAGE_NAME?=github.com/projectcalico/calico/calico_node

LIBCALICOGO_PATH?=none
Expand Down
8 changes: 8 additions & 0 deletions calico_node/startup/startup.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ var DEFAULT_INTERFACES_TO_EXCLUDE []string = []string{
"cali.*", "tunl.*", "flannel.*",
}

// Version string, set during build.
var VERSION string

// For testing purposes we define an exit function that we can override.
var exitFunction = os.Exit

Expand Down Expand Up @@ -763,6 +766,11 @@ func ensureDefaultConfig(c *client.Client, node *api.Node) error {
return err
}

// Store the Calico Version as a global felix config setting.
if err := c.Config().SetFelixConfig("CalicoVersion", "", VERSION); err != nil {
return err
}

// Set the default values for some of the global BGP config values and
// per-node directory structure.
// These are required by both confd and the GoBGP daemon. Some of this
Expand Down

0 comments on commit 43b069c

Please sign in to comment.