Documentation ¶
Index ¶
- Constants
- Variables
- func GetClusterVersion() string
- func GetCrdV1(crdString string) (apiextensionsv1.CustomResourceDefinition, error)
- func GetCrdV1AndBeta1Slice(crdStrings []string) ([]apiextensionsv1.CustomResourceDefinition, ...)
- func GetCrdV1Beta1(crdString string) (apiextensionsv1beta1.CustomResourceDefinition, error)
- func SetClusterVersion(version string)
- func SetupClusterVersion() error
- func SupportCRDUseV1() bool
- func SupportCRDUseV1Beta1() bool
- type Info
Constants ¶
const ( // ServiceNameManager defines name of current manager service component ServiceNameManager = "kappital-manager" // ServiceNameEngine defines name of current engine service component ServiceNameEngine = "kappital-engine" )
Variables ¶
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 ¶
func GetCrdV1(crdString string) (apiextensionsv1.CustomResourceDefinition, error)
GetCrdV1 get and analysis the crd to apiextensionsv1
func GetCrdV1AndBeta1Slice ¶
func GetCrdV1AndBeta1Slice(crdStrings []string) ([]apiextensionsv1.CustomResourceDefinition, []apiextensionsv1beta1.CustomResourceDefinition)
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.