fips oss version changes (#17500)

This commit is contained in:
skpratt 2023-05-29 13:02:06 -05:00 committed by GitHub
parent e1df0f28bd
commit 0944f71457
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View File

@ -49,6 +49,10 @@ func (_ *prettyFormatter) Format(info *VersionInfo) (string, error) {
buffer.WriteString(fmt.Sprintf("Build Date %s\n", info.BuildDate.Format(time.RFC3339)))
if info.FIPS != "" {
buffer.WriteString(fmt.Sprintf("FIPS: %s\n", info.FIPS))
}
var supplement string
if info.RPC.Default < info.RPC.Max {
supplement = fmt.Sprintf(" (agent will automatically use protocol >%d when speaking to compatible agents)",

View File

@ -9,10 +9,11 @@ import (
"strings"
"time"
"github.com/mitchellh/cli"
"github.com/hashicorp/consul/agent/consul"
"github.com/hashicorp/consul/command/flags"
"github.com/hashicorp/consul/version"
"github.com/mitchellh/cli"
)
func New(ui cli.Ui) *cmd {
@ -50,6 +51,7 @@ type VersionInfo struct {
Version string
Revision string
Prerelease string
FIPS string `json:",omitempty"`
BuildDate time.Time
RPC RPCVersionInfo
}
@ -78,6 +80,7 @@ func (c *cmd) Run(args []string) int {
Revision: version.GitCommit,
Prerelease: version.VersionPrerelease,
BuildDate: buildDate,
FIPS: version.GetFIPSInfo(),
RPC: RPCVersionInfo{
Default: consul.DefaultRPCProtocol,
Min: int(consul.ProtocolVersionMin),

7
version/fips.go Normal file
View File

@ -0,0 +1,7 @@
//go:build !fips
package version
func GetFIPSInfo() string {
return ""
}