version

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ServiceNameManager defines name of current manager service component
	ServiceNameManager = "kappital-manager"
	// ServiceNameEngine defines name of current engine service component
	ServiceNameEngine = "kappital-engine"
)

Variables

View Source
var (
	// Flags of get the version of module
	Flags = sets.NewString("version", "--version", "-v")
)

Functions

func GetClusterVersion

func GetClusterVersion() string

GetClusterVersion get the version of cluster, it will use for the crd

func GetCrdV1

GetCrdV1 get and analysis the crd to apiextensionsv1

func GetCrdV1AndBeta1Slice

GetCrdV1AndBeta1Slice get the CRD to slices for apiextensionsv1 and v1beta1

func GetCrdV1Beta1

func GetCrdV1Beta1(crdString string) (apiextensionsv1beta1.CustomResourceDefinition, error)

GetCrdV1Beta1 get and analysis the crd to v1beta1

func SetClusterVersion

func SetClusterVersion(version string)

SetClusterVersion set the version of cluster, it will be used for the unit test to set a fake cluster version

func SetupClusterVersion

func SetupClusterVersion() error

SetupClusterVersion get the kubernetes cluster version, and save it in the runtime memory

func SupportCRDUseV1

func SupportCRDUseV1() bool

SupportCRDUseV1 the cluster version 1.15 above will support apiextensionsv1 for the crd

func SupportCRDUseV1Beta1

func SupportCRDUseV1Beta1() bool

SupportCRDUseV1Beta1 the cluster version 1.22 and below will support v1beta1 version crd, but, 1.22 above cluster will discard v1beta1 version

Types

type Info

type Info struct {
	ServiceName  string `json:"ServiceName"`
	GitVersion   string `json:"GitVersion"`
	GitCommit    string `json:"GitCommit"`
	GitTreeState string `json:"GitTreeState"`
	BuildDate    string `json:"BuildDate"`
	GoVersion    string `json:"GoVersion"`
	Compiler     string `json:"Compiler"`
	Platform     string `json:"Platform"`
}

Info contains versioning information.

func Get

func Get(serviceName string) Info

Get returns the overall codebase version. It's for detecting what code a binary was built from.

func (Info) String

func (info Info) String() string

String returns a Go-syntax representation of the Info.

Jump to

Keyboard shortcuts

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