Skip to content

Commit

Permalink
Never default to a qualifier when none of them are set. (#9148)
Browse files Browse the repository at this point in the history
Remove default version qualifier and rename the environment variable to set it from `BEAT_VERSION_QUALIFIER` to `VERSION_QUALIFIER` this will align with other parts of the stack.

**Tested with filebeat.**
```
 ❯ ./filebeat version                                                                                                                                                                                                                                                                                                                                          [08:39:01]
filebeat version 7.0.0 (amd64), libbeat 7.0.0 [0a0c267 built 2018-11-19 13:38:15 +0000 UTC]
```

**Without the patch**
```
 ❯ ./filebeat version                                                                                                                                                                                                                                                                                                                                          [08:40:07]
filebeat version 7.0.0-alpha1 (amd64), libbeat 7.0.0-alpha1 [b007837 built 2018-11-19 13:39:59 +0000 UTC]
```

Fixes: #8384
  • Loading branch information
ph committed Nov 19, 2018
1 parent 48a7397 commit 0697bc6
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-developer.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ The list below covers the major changes between 6.3.0 and master only.
- Fix permissions of generated Filebeat filesets. {pull}7140[7140]
- Collect fields from _meta/fields.yml too. {pull}8397[8397]
- Fix issue on asset generation that could lead to different results in Windows. {pull}8464[8464]
- Remove default version qualifier, you can use `VERSION_QUALIFIER` environment variable to set it. {pull}9148[9148]

==== Added

Expand Down
2 changes: 1 addition & 1 deletion auditbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func Clean() error {
// Package packages the Beat for distribution.
// Use SNAPSHOT=true to build snapshots.
// Use PLATFORMS to control the target platforms.
// Use BEAT_VERSION_QUALIFIER to control the version qualifier.
// Use VERSION_QUALIFIER to control the version qualifier.
func Package() {
start := time.Now()
defer func() { fmt.Println("package ran for", time.Since(start)) }()
Expand Down
1 change: 0 additions & 1 deletion dev-tools/jenkins_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ trap cleanup EXIT

# This controls the defaults used the Jenkins package job. They can be
# overridden by setting them in the environement prior to running this script.
export BEAT_VERSION_QUALIFIER="${VERSION_QUALIFIER}"
export SNAPSHOT="${SNAPSHOT:-true}"
export PLATFORMS="${PLATFORMS:-+linux/armv7 +linux/ppc64le +linux/s390x +linux/mips64}"

Expand Down
2 changes: 1 addition & 1 deletion dev-tools/mage/crossbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func (b GolangCrossBuilder) Build() error {
)
}
if versionQualified {
args = append(args, "--env", "BEAT_VERSION_QUALIFIER="+versionQualifier)
args = append(args, "--env", "VERSION_QUALIFIER="+versionQualifier)
}
args = append(args,
"--rm",
Expand Down
4 changes: 2 additions & 2 deletions dev-tools/mage/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func init() {
panic(errors.Errorf("failed to parse SNAPSHOT env value", err))
}

versionQualifier, versionQualified = os.LookupEnv("BEAT_VERSION_QUALIFIER")
versionQualifier, versionQualified = os.LookupEnv("VERSION_QUALIFIER")
}

// EnvMap returns map containing the common settings variables and all variables
Expand Down Expand Up @@ -319,7 +319,7 @@ var (
)

// BeatQualifiedVersion returns the Beat's qualified version. The value can be overwritten by
// setting BEAT_VERSION_QUALIFIER in the environment.
// setting VERSION_QUALIFIER in the environment.
func BeatQualifiedVersion() (string, error) {
version, err := beatVersion()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion filebeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func Clean() error {
// Package packages the Beat for distribution.
// Use SNAPSHOT=true to build snapshots.
// Use PLATFORMS to control the target platforms.
// Use BEAT_VERSION_QUALIFIER to control the version qualifier.
// Use VERSION_QUALIFIER to control the version qualifier.
func Package() {
start := time.Now()
defer func() { fmt.Println("package ran for", time.Since(start)) }()
Expand Down
2 changes: 1 addition & 1 deletion heartbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func Clean() error {
// Package packages the Beat for distribution.
// Use SNAPSHOT=true to build snapshots.
// Use PLATFORMS to control the target platforms.
// Use BEAT_VERSION_QUALIFIER to control the version qualifier.
// Use VERSION_QUALIFIER to control the version qualifier.
func Package() {
start := time.Now()
defer func() { fmt.Println("package ran for", time.Since(start)) }()
Expand Down
2 changes: 1 addition & 1 deletion libbeat/version/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func GetDefaultVersion() string {
var (
buildTime = "unknown"
commit = "unknown"
qualifier = "alpha1"
qualifier = ""
)

// BuildTime exposes the compile-time build time information.
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func Clean() error {
// Package packages the Beat for distribution.
// Use SNAPSHOT=true to build snapshots.
// Use PLATFORMS to control the target platforms.
// Use BEAT_VERSION_QUALIFIER to control the version qualifier.
// Use VERSION_QUALIFIER to control the version qualifier.
func Package() {
start := time.Now()
defer func() { fmt.Println("package ran for", time.Since(start)) }()
Expand Down
2 changes: 1 addition & 1 deletion packetbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func Clean() error {
// Package packages the Beat for distribution.
// Use SNAPSHOT=true to build snapshots.
// Use PLATFORMS to control the target platforms.
// Use BEAT_VERSION_QUALIFIER to control the version qualifier.
// Use VERSION_QUALIFIER to control the version qualifier.
func Package() {
start := time.Now()
defer func() { fmt.Println("package ran for", time.Since(start)) }()
Expand Down
2 changes: 1 addition & 1 deletion winlogbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func Clean() error {
// Package packages the Beat for distribution.
// Use SNAPSHOT=true to build snapshots.
// Use PLATFORMS to control the target platforms.
// Use BEAT_VERSION_QUALIFIER to control the version qualifier.
// Use VERSION_QUALIFIER to control the version qualifier.
func Package() {
start := time.Now()
defer func() { fmt.Println("package ran for", time.Since(start)) }()
Expand Down

0 comments on commit 0697bc6

Please sign in to comment.