version

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: Apache-2.0 Imports: 12 Imported by: 24

Documentation

Overview

Package version keeps track of the Kubernetes version the client is connected to

Index

Constants

View Source
const (
	// MinimalVersionConstraint is the minimal version that Cilium supports to
	// run kubernetes.
	MinimalVersionConstraint = "1.12.0"
)

Variables

This section is empty.

Functions

func Force

func Force(version string) error

Force forces the use of a specific version

func Update

func Update(client kubernetes.Interface, conf k8sconfig.Configuration) error

Update retrieves the version of the Kubernetes apiserver and derives the capabilities. This function must be called after connectivity to the apiserver has been established.

Discovery of capabilities only works if the discovery API of the apiserver is functional. If it is not available, a warning is logged and the discovery falls back to probing individual API endpoints.

func Version

func Version() go_version.Version

Version returns the version of the Kubernetes apiserver

Types

type ServerCapabilities

type ServerCapabilities struct {
	// Patch is the ability to use PATCH to modify a resource
	Patch bool

	// MinimalVersionMet is true when the minimal version of Kubernetes
	// required to run Cilium has been met
	MinimalVersionMet bool

	// EndpointSlice is the ability of k8s server to support endpoint slices
	EndpointSlice bool

	// LeasesResourceLock is the ability of K8s server to support Lease type
	// from coordination.k8s.io/v1 API for leader election purposes(currently only in operator).
	// https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#lease-v1-coordination-k8s-io
	//
	// This capability was introduced in K8s version 1.14, prior to which
	// we don't support HA mode for the cilium-operator.
	LeasesResourceLock bool

	// APIExtensionsV1CRD is set to true when the K8s server supports
	// apiextensions/v1 CRDs. TODO: Add link to docs
	//
	// This capability was introduced in K8s version 1.16, prior to which
	// apiextensions/v1beta1 CRDs were used exclusively.
	APIExtensionsV1CRD bool

	// WatchPartialObjectMetadata is set to true when the K8s server supports a
	// watch operation on the metav1.PartialObjectMetadata (and metav1.Table)
	// resource.
	//
	// This capability was introduced in K8s version 1.15, prior to which
	// watches cannot be performed on the aforementioned resources.
	//
	// Source:
	//   - KEP:
	//   https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/20190322-server-side-get-to-ga.md#goals
	//   - PR: https://github.com/kubernetes/kubernetes/pull/71548
	WatchPartialObjectMetadata bool
}

ServerCapabilities is a list of server capabilities derived based on version, the Kubernetes discovery API, or probing of individual API endpoints.

func Capabilities

func Capabilities() ServerCapabilities

Capabilities returns the capabilities of the Kubernetes apiserver

Jump to

Keyboard shortcuts

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