mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-07-20 20:44:51 -04:00
Bumps [github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa) from 1.18.1 to 1.18.2. - [Release notes](https://github.com/open-policy-agent/opa/releases) - [Changelog](https://github.com/open-policy-agent/opa/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-policy-agent/opa/compare/v1.18.1...v1.18.2) --- updated-dependencies: - dependency-name: github.com/open-policy-agent/opa dependency-version: 1.18.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
59 lines
1.1 KiB
Go
59 lines
1.1 KiB
Go
// Copyright 2016 The OPA Authors. All rights reserved.
|
|
// Use of this source code is governed by an Apache2
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// Package version contains version information that is set at build time.
|
|
package version
|
|
|
|
import (
|
|
"runtime"
|
|
"runtime/debug"
|
|
)
|
|
|
|
var Version = "1.18.2"
|
|
|
|
// GoVersion is the version of Go this was built with
|
|
var GoVersion = runtime.Version()
|
|
|
|
// Platform is the runtime OS and architecture of this OPA binary
|
|
var Platform = runtime.GOOS + "/" + runtime.GOARCH
|
|
|
|
// Additional version information that is displayed by the "version" command and used to
|
|
// identify the version of running instances of OPA.
|
|
var (
|
|
Vcs = ""
|
|
Timestamp = ""
|
|
Hostname = ""
|
|
)
|
|
|
|
func init() {
|
|
bi, ok := debug.ReadBuildInfo()
|
|
if !ok {
|
|
return
|
|
}
|
|
var dirty bool
|
|
var binTimestamp, binVcs string
|
|
|
|
for _, s := range bi.Settings {
|
|
switch s.Key {
|
|
case "vcs.time":
|
|
binTimestamp = s.Value
|
|
case "vcs.revision":
|
|
binVcs = s.Value
|
|
case "vcs.modified":
|
|
dirty = s.Value == "true"
|
|
}
|
|
}
|
|
|
|
if Timestamp == "" {
|
|
Timestamp = binTimestamp
|
|
}
|
|
|
|
if Vcs == "" {
|
|
Vcs = binVcs
|
|
if dirty {
|
|
Vcs += "-dirty"
|
|
}
|
|
}
|
|
}
|