test

package
v3.0.0-...-d6c4d9c Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareOutput

func CompareOutput(t *testing.T, name, output string, update bool, suffix string)

func LatestKubernetesVersion

func LatestKubernetesVersion(cfg *kubermaticv1.KubermaticConfiguration) *semver.Semver

LatestKubernetesVersion returns the most recent supported patch release. Passing nil for the KubermaticConfiguration is fine and in this case the compiled-in defaults will be used.

func LatestKubernetesVersionForRelease

func LatestKubernetesVersionForRelease(release string, cfg *kubermaticv1.KubermaticConfiguration) *semver.Semver

LatestKubernetesVersionForRelease returns the most recent supported patch release for a given release branch (i.e. release="1.24" might return "1.24.7"). Passing nil for the KubermaticConfiguration is fine and in this case the compiled-in defaults will be used.

func LatestStableKubernetesVersion

func LatestStableKubernetesVersion(cfg *kubermaticv1.KubermaticConfiguration) *semver.Semver

LatestStableKubernetesVersion returns the most recent patch release of the "stable" releases, which are latest-1 (i.e. if KKP is configured to support up to 1.29.7, then the stable releases would be all in the 1.28.x line). Passing nil for the KubermaticConfiguration is fine and in this case the compiled-in defaults will be used.

func NewDatacenterGetter

func NewDatacenterGetter(datacenter *kubermaticv1.Datacenter) provider.DatacenterGetter

func NewDatacentersGetter

func NewDatacentersGetter(datacenters ...*kubermaticv1.Datacenter) provider.DatacentersGetter

func ObjectYAMLDiff

func ObjectYAMLDiff(t *testing.T, expectedObj, actualObj interface{}) error

func ParseVersionOrRelease

func ParseVersionOrRelease(release string, cfg *kubermaticv1.KubermaticConfiguration) *semver.Semver

ParseVersionOrRelease returns the most recent supported patch release for a given release branch (i.e. release="1.24" might return "1.24.7"). Passing nil for the KubermaticConfiguration is fine and in this case the compiled-in defaults will be used. If the release is empty, the default version is returned.

func SafeBase64Decoding

func SafeBase64Decoding(value string) string

SafeBase64Decoding takes a value and decodes it with base64, but only if the given value can be decoded without errors. This primarily exists because in older KKP releases, we sometimes had pre-base64-encoded secrets in Vault, but during 2022 migrated to keeping plaintext in Vault.

func SafeBase64Encoding

func SafeBase64Encoding(value string) string

SafeBase64Encoding takes a value and encodes it with base64, but only if the given value was not already base64-encoded.

Types

type EndpointsBuilder

type EndpointsBuilder struct {
	ObjectBuilder
	// contains filtered or unexported fields
}

EndpointsBuilder is a builder providing a fluent API for v1.Endpoints creation.

func NewEndpointsBuilder

func NewEndpointsBuilder(nn NamespacedName) *EndpointsBuilder

NewServiceBuilder returns a ServiceBuilder to be used to build a v1.Endpoints with name and namespace given in input.

func (*EndpointsBuilder) Build

func (b *EndpointsBuilder) Build() *corev1.Endpoints

func (*EndpointsBuilder) WithEndpointsSubset

func (b *EndpointsBuilder) WithEndpointsSubset() *epsSubsetBuilder

WithEndpointsSubset starts the creation of an Endpoints Subset, the creation must me terminated with a call to DoneWithEndpointSubset, after ports and addresses are added.

func (*EndpointsBuilder) WithResourceVersion

func (b *EndpointsBuilder) WithResourceVersion(rs string) *EndpointsBuilder

type NamespacedName

type NamespacedName types.NamespacedName

type ObjectBuilder

type ObjectBuilder metav1.ObjectMeta

func (*ObjectBuilder) WithAnnotation

func (b *ObjectBuilder) WithAnnotation(key, value string) *ObjectBuilder

func (*ObjectBuilder) WithCreationTimestamp

func (b *ObjectBuilder) WithCreationTimestamp(time time.Time) *ObjectBuilder

func (*ObjectBuilder) WithLabel

func (b *ObjectBuilder) WithLabel(key, value string) *ObjectBuilder

func (*ObjectBuilder) WithResourceVersion

func (b *ObjectBuilder) WithResourceVersion(rv string) *ObjectBuilder

type ServiceBuilder

type ServiceBuilder struct {
	ObjectBuilder
	// contains filtered or unexported fields
}

ServiceBuilder is a builder providing a fluent API for v1.Service creation.

func NewServiceBuilder

func NewServiceBuilder(nn NamespacedName) *ServiceBuilder

NewServiceBuilder returns a ServiceBuilder to be used to build a v1.Service with name and namespace given in input.

func (ServiceBuilder) Build

func (b ServiceBuilder) Build() *corev1.Service

func (*ServiceBuilder) WithAnnotation

func (b *ServiceBuilder) WithAnnotation(key, value string) *ServiceBuilder

func (*ServiceBuilder) WithCreationTimestamp

func (b *ServiceBuilder) WithCreationTimestamp(time time.Time) *ServiceBuilder

func (*ServiceBuilder) WithLabel

func (b *ServiceBuilder) WithLabel(key, value string) *ServiceBuilder

func (*ServiceBuilder) WithSelector

func (b *ServiceBuilder) WithSelector(selector map[string]string) *ServiceBuilder

func (*ServiceBuilder) WithServicePort

func (b *ServiceBuilder) WithServicePort(
	name string,
	port int32,
	nodePort int32,
	targetPort intstr.IntOrString,
	protocol corev1.Protocol) *ServiceBuilder

func (*ServiceBuilder) WithServicePorts

func (b *ServiceBuilder) WithServicePorts(sp ...corev1.ServicePort) *ServiceBuilder

func (*ServiceBuilder) WithServiceType

func (b *ServiceBuilder) WithServiceType(serviceType corev1.ServiceType) *ServiceBuilder

Directories

Path Synopsis
clusterexposer
cmd
e2e
jig

Jump to

Keyboard shortcuts

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