version

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package version provides version information for the compiled binary, and an HTTP handler to serve the version information via an HTTP request.

Index

Constants

This section is empty.

Variables

View Source
var (
	// MinK8sVersion is the minimum version of Kubernetes that the operator supports.
	MinK8sVersion = semver.Version{Major: 1, Minor: 19, Patch: 0}

	// MinEndpointSliceVersion is the minimum version of Kubernetes that supports EndpointSlice.
	// stable since Kubernetes v1.21
	// https://kubernetes.io/docs/concepts/services-networking/endpoint-slices/
	MinEndpointSliceVersion = semver.Version{Major: 1, Minor: 21, Patch: 0}

	// MinDualStackSliceVersion is the minimum version of Kubernetes that supports IPv4/IPv6 dual-stack.
	// IPv4/IPv6 dual-stack networking is enabled by default for your Kubernetes cluster starting in 1.21
	// https://kubernetes.io/docs/concepts/services-networking/dual-stack/
	MinDualStackSliceVersion = semver.Version{Major: 1, Minor: 21, Patch: 0}

	// MinK8sVersionForGatewayAPI is the minimum version of Kubernetes that supports Gateway API.
	MinK8sVersionForGatewayAPI = MinK8sVersion

	// MinK8sVersionForCELValidation is the minimum version of Kubernetes that supports CustomResourceValidationExpressions.
	// This feature was introduced since Kubernetes 1.23 but turned off by default.
	// It has been turned on by default since Kubernetes 1.25 and finally graduated to GA in Kubernetes 1.29
	// https://github.com/kubernetes/enhancements/issues/2876
	MinK8sVersionForCELValidation = semver.Version{Major: 1, Minor: 25, Patch: 0}
)
View Source
var BuildDate string

BuildDate is the date when the binary was built

View Source
var GitCommit string

GitCommit is the commit hash when the binary was built

View Source
var (
	// ServerVersion is the version of the Kubernetes cluster the operator is running in.
	ServerVersion = semver.Version{Major: 0, Minor: 0, Patch: 0}
)
View Source
var Version string

Version is the version of the compiled software

Functions

func GetVersionHandler added in v1.0.0

func GetVersionHandler() http.Handler

GetVersionHandler returns an HTTP handler that returns the version info

func IsCELValidationEnabled added in v1.3.3

func IsCELValidationEnabled(kubeClient kubernetes.Interface) bool

IsCELValidationEnabled returns true if CustomResourceValidationExpressions are enabled in the Kubernetes cluster.

func IsDualStackEnabled added in v1.3.0

func IsDualStackEnabled(kubeClient kubernetes.Interface) bool

IsDualStackEnabled returns true if IPv4/IPv6 dual-stack is enabled in the Kubernetes cluster.

func IsEndpointSliceEnabled added in v0.2.0

func IsEndpointSliceEnabled(kubeClient kubernetes.Interface) bool

IsEndpointSliceEnabled returns true if EndpointSlice is enabled in the Kubernetes cluster.

func IsSupportedK8sVersion

func IsSupportedK8sVersion(kubeClient kubernetes.Interface) bool

IsSupportedK8sVersion returns true if the Kubernetes cluster version is supported by the operator.

func IsSupportedK8sVersionForGatewayAPI added in v1.1.0

func IsSupportedK8sVersionForGatewayAPI(kubeClient kubernetes.Interface) bool

IsSupportedK8sVersionForGatewayAPI returns true if the Kubernetes cluster version is supported by the operator.

func SetMetric added in v1.0.0

func SetMetric()

SetMetric is a one time call to expose the version info via prometheus metrics.

Types

type Info added in v1.0.0

type Info struct {
	// Version is the version of the FSM Controller.
	Version string `json:"version,omitempty"`

	// GitCommit is the git commit hash of the FSM Controller.
	GitCommit string `json:"git_commit,omitempty"`

	// BuildDate is the build date of the FSM Controller.
	BuildDate string `json:"build_date,omitempty"`
}

Info is a struct helpful for JSON serialization of the FSM Controller version information.

func GetInfo added in v1.0.0

func GetInfo() Info

GetInfo returns the version info

Jump to

Keyboard shortcuts

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