test

package
v2.23.5 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GatekeeperSchemeBuilder = runtime.NewSchemeBuilder(addKnownGatekeeperTypes)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: "constraints.gatekeeper.sh", Version: "v1beta1"}

SchemeGroupVersion is group version used to register these objects.

Functions

func CompareOutput

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

func LatestKubernetesVersion added in v2.21.0

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 added in v2.21.0

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 added in v2.21.0

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 NewSeedGetter added in v2.19.0

func NewSeedGetter(seed *kubermaticv1.Seed) provider.SeedGetter

func NewSeedsGetter added in v2.19.0

func NewSeedsGetter(seeds ...*kubermaticv1.Seed) provider.SeedsGetter

func ObjectYAMLDiff added in v2.20.0

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

func ParseVersionOrRelease added in v2.22.0

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 added in v2.19.9

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 added in v2.19.9

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 ConstraintSpec added in v2.22.0

type ConstraintSpec struct {
	Match             kubermaticv1.Match     `json:"match,omitempty"`
	Parameters        map[string]interface{} `json:"parameters,omitempty"`
	EnforcementAction string                 `json:"enforcementAction,omitempty"`
}

func (*ConstraintSpec) DeepCopy added in v2.22.0

func (in *ConstraintSpec) DeepCopy() *ConstraintSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequiredLabelSpec.

func (*ConstraintSpec) DeepCopyInto added in v2.22.0

func (in *ConstraintSpec) DeepCopyInto(out *ConstraintSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConstraintStatus added in v2.22.0

type ConstraintStatus struct {
	Enforcement    string      `json:"enforcement,omitempty"`
	AuditTimestamp string      `json:"auditTimestamp,omitempty"`
	Violations     []Violation `json:"violations,omitempty"`
}

func (*ConstraintStatus) DeepCopy added in v2.22.0

func (in *ConstraintStatus) DeepCopy() *ConstraintStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConstraintStatus.

func (*ConstraintStatus) DeepCopyInto added in v2.22.0

func (in *ConstraintStatus) DeepCopyInto(out *ConstraintStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EndpointsBuilder added in v2.16.3

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

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

func NewEndpointsBuilder added in v2.16.3

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 added in v2.16.3

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

func (*EndpointsBuilder) WithEndpointsSubset added in v2.16.3

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 added in v2.16.3

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

type NamespacedName added in v2.16.3

type NamespacedName types.NamespacedName

type ObjectBuilder added in v2.16.3

type ObjectBuilder metav1.ObjectMeta

func (*ObjectBuilder) WithAnnotation added in v2.16.3

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

func (*ObjectBuilder) WithCreationTimestamp added in v2.16.3

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

func (*ObjectBuilder) WithLabel added in v2.16.3

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

func (*ObjectBuilder) WithResourceVersion added in v2.16.3

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

type RequiredLabel added in v2.22.0

type RequiredLabel struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ConstraintSpec   `json:"spec,omitempty"`
	Status ConstraintStatus `json:"status,omitempty"`
}

func (*RequiredLabel) DeepCopy added in v2.22.0

func (in *RequiredLabel) DeepCopy() *RequiredLabel

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequiredLabel.

func (*RequiredLabel) DeepCopyInto added in v2.22.0

func (in *RequiredLabel) DeepCopyInto(out *RequiredLabel)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RequiredLabel) DeepCopyObject added in v2.22.0

func (in *RequiredLabel) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RequiredLabelList added in v2.22.0

type RequiredLabelList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []runtime.RawExtension `json:"items"`
}

func (*RequiredLabelList) DeepCopy added in v2.22.0

func (in *RequiredLabelList) DeepCopy() *RequiredLabelList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequiredLabelList.

func (*RequiredLabelList) DeepCopyInto added in v2.22.0

func (in *RequiredLabelList) DeepCopyInto(out *RequiredLabelList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RequiredLabelList) DeepCopyObject added in v2.22.0

func (in *RequiredLabelList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ServiceBuilder added in v2.16.3

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

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

func NewServiceBuilder added in v2.16.3

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 added in v2.16.3

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

func (*ServiceBuilder) WithAnnotation added in v2.16.3

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

func (*ServiceBuilder) WithCreationTimestamp added in v2.16.3

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

func (*ServiceBuilder) WithLabel added in v2.16.3

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

func (*ServiceBuilder) WithSelector added in v2.16.3

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

func (*ServiceBuilder) WithServicePort added in v2.16.3

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

func (*ServiceBuilder) WithServicePorts added in v2.16.3

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

func (*ServiceBuilder) WithServiceType added in v2.16.3

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

type UniqueLabel added in v2.22.0

type UniqueLabel struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ConstraintSpec   `json:"spec,omitempty"`
	Status ConstraintStatus `json:"status,omitempty"`
}

+genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*UniqueLabel) DeepCopy added in v2.22.0

func (in *UniqueLabel) DeepCopy() *UniqueLabel

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UniqueLabel.

func (*UniqueLabel) DeepCopyInto added in v2.22.0

func (in *UniqueLabel) DeepCopyInto(out *UniqueLabel)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*UniqueLabel) DeepCopyObject added in v2.22.0

func (in *UniqueLabel) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type UniqueLabelList added in v2.22.0

type UniqueLabelList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []runtime.RawExtension `json:"items"`
}

func (*UniqueLabelList) DeepCopy added in v2.22.0

func (in *UniqueLabelList) DeepCopy() *UniqueLabelList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UniqueLabelList.

func (*UniqueLabelList) DeepCopyInto added in v2.22.0

func (in *UniqueLabelList) DeepCopyInto(out *UniqueLabelList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*UniqueLabelList) DeepCopyObject added in v2.22.0

func (in *UniqueLabelList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type Violation added in v2.22.0

type Violation struct {
	EnforcementAction string `json:"enforcementAction,omitempty"`
	Kind              string `json:"kind,omitempty"`
	Message           string `json:"message,omitempty"`
	Name              string `json:"name,omitempty"`
	Namespace         string `json:"namespace,omitempty"`
}

func (*Violation) DeepCopy added in v2.22.0

func (in *Violation) DeepCopy() *Violation

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Violation.

func (*Violation) DeepCopyInto added in v2.22.0

func (in *Violation) DeepCopyInto(out *Violation)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

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