version

package
v0.0.0-...-518b544 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 216

Documentation

Overview

Package version provides build version information.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Info exports the build version information.
	Info       BuildInfo
	DockerInfo DockerBuildInfo
)

Functions

func CobraCommand

func CobraCommand() *cobra.Command

CobraCommand returns a command used to print version information.

func CobraCommandWithOptions

func CobraCommandWithOptions(options CobraOptions) *cobra.Command

CobraCommandWithOptions returns a command used to print version information. It accepts an CobraOptions argument that might modify its behavior

Types

type BuildInfo

type BuildInfo struct {
	Version       string `json:"version"`
	GitRevision   string `json:"revision"`
	GolangVersion string `json:"golang_version"`
	BuildStatus   string `json:"status"`
	GitTag        string `json:"tag"`
}

BuildInfo describes version information about the binary build.

func (BuildInfo) LongForm

func (b BuildInfo) LongForm() string

LongForm returns a dump of the Info struct This looks like:

func (BuildInfo) RecordComponentBuildTag

func (b BuildInfo) RecordComponentBuildTag(component string)

RecordComponentBuildTag sets the value for a metric that will be used to track component build tags for tracking rollouts, etc.

func (BuildInfo) String

func (b BuildInfo) String() string

String produces a single-line version info

This looks like:

``` u<version>-<git revision>-<build status> ```

type CobraOptions

type CobraOptions struct {
	// GetRemoteVersion is the function to be invoked to retrieve remote versions for
	// Istio components. Optional. If not set, the 'version' subcommand will not attempt
	// to connect to a remote side, and CLI flags such as '--remote' will be hidden.
	GetRemoteVersion GetRemoteVersionFunc
	GetProxyVersions GetProxyVersionFunc
}

CobraOptions holds options to be passed to `CobraCommandWithOptions`

type DockerBuildInfo

type DockerBuildInfo struct {
	Hub  string
	Tag  string
	OS   string
	Arch string
}

DockerBuildInfo contains and exposes Hub: buildHub, Tag: buildVersion, OS: buildOS, and Arch: buildArch

type GetProxyVersionFunc

type GetProxyVersionFunc func() (*[]ProxyInfo, error)

GetRemoteVersionFunc is the function prototype to be passed to CobraOptions so that it is called when invoking `cmd version`

type GetRemoteVersionFunc

type GetRemoteVersionFunc func() (*MeshInfo, error)

GetRemoteVersionFunc is the function prototype to be passed to CobraOptions so that it is called when invoking `cmd version`

type MeshInfo

type MeshInfo []ServerInfo

MeshInfo contains the versions for all Istio control plane components

type NodeType

type NodeType string

NodeType decides the responsibility of the proxy serves in the mesh

func ToUserFacingNodeType

func ToUserFacingNodeType(t string) NodeType

type ProxyInfo

type ProxyInfo struct {
	ID           string
	IstioVersion string
	Type         NodeType
}

ProxyInfo contains the version for a single data plane component

type ServerInfo

type ServerInfo struct {
	Component string
	Revision  string
	Info      BuildInfo
}

ServerInfo contains the version for a single control plane component

type Version

type Version struct {
	ClientVersion    *BuildInfo   `json:"clientVersion,omitempty" yaml:"clientVersion,omitempty"`
	MeshVersion      *MeshInfo    `json:"meshVersion,omitempty" yaml:"meshVersion,omitempty"`
	DataPlaneVersion *[]ProxyInfo `json:"dataPlaneVersion,omitempty" yaml:"dataPlaneVersion,omitempty"`
}

Version holds info for client and control plane versions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL