Skip to content

Commit ce16c4a

Browse files
Merge pull request #17 from ibuildthecloud/master
Fix version labels
2 parents 7a9a9c9 + fc0fd20 commit ce16c4a

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Makefile

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PROG=rke2
22
GOLANGCI_VERSION=v1.25.1
33
REPO ?= rancher
44
IMAGE=${REPO}/rke2-runtime
5-
PKG=github.com/rancher/rke2
5+
K3S_PKG=github.com/rancher/k3s
66

77
ifneq "$(strip $(shell command -v go 2>/dev/null))" ""
88
GOOS ?= $(shell go env GOOS)
@@ -39,7 +39,11 @@ else
3939
DEBUG_GO_GCFLAGS := -gcflags=all="-N -l"
4040
endif
4141

42-
VERSION=$(shell git describe --match 'v[0-9]*' --dirty='.dirty' --always --tags)
42+
ifdef DRONE_TAG
43+
VERSION=${DRONE_TAG}
44+
else
45+
VERSION?=$(shell git describe --match 'v[0-9]*' --dirty='.dirty' --always --tags)
46+
endif
4347
REVISION=$(shell git rev-parse HEAD)$(shell if ! git diff --no-ext-diff --quiet --exit-code; then echo .dirty; fi)
4448
RELEASE=${PROG}-$(VERSION).${GOOS}-${GOARCH}
4549

@@ -49,7 +53,7 @@ endif
4953
GO_BUILDTAGS ?= no_embedded_executor
5054
GO_BUILDTAGS += ${DEBUG_TAGS}
5155
GO_TAGS=$(if $(GO_BUILDTAGS),-tags "$(GO_BUILDTAGS)",)
52-
GO_LDFLAGS=-ldflags '-X $(PKG)/version.Program=$(PROG) -X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PACKAGE) $(EXTRA_LDFLAGS)'
56+
GO_LDFLAGS=-ldflags '-X $(K3S_PKG)/pkg/version.Program=$(PROG) -X $(K3S_PKG)/pkg/version.Version=$(VERSION) -X $(K3S_PKG)/pkg/version.Revision=$(REVISION) $(EXTRA_LDFLAGS)'
5357

5458

5559
default: in-docker-build ## Build using docker environment (default target)

pkg/cli/cmds/root.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ var (
1616
commonFlag = []cli.Flag{
1717
cli.StringFlag{
1818
Name: "repo",
19-
Usage: "(image) Image repository to use for RKE2 images",
19+
Usage: "(image) Image repository override for for RKE2 images",
2020
EnvVar: "RKE2_REPO",
21-
Value: "rancher",
2221
Destination: &config.Repo,
2322
},
2423
}

0 commit comments

Comments
 (0)