common

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddContainerPort added in v1.1.0

func AddContainerPort(ports *[]core.ContainerPort, port *core.ContainerPort)

func AddPortToService added in v1.1.0

func AddPortToService(service *core.Service, port *core.ServicePort)

func AddRuleToNetworkPolicy added in v1.1.0

func AddRuleToNetworkPolicy(policy *networking.NetworkPolicy, rule *networking.NetworkPolicyIngressRule)

func AddVolumeMountToContainer added in v1.1.0

func AddVolumeMountToContainer(container *core.Container, volumeMount *core.VolumeMount)

func AssertEquals added in v1.1.0

func AssertEquals(t *testing.T, expected interface{}, actual interface{})

func AssertIsInOrder added in v1.1.0

func AssertIsInOrder(t *testing.T, list []interface{}, before interface{}, after interface{})

func AssertSliceContains added in v1.1.0

func AssertSliceContains(t *testing.T, haystack []interface{}, needle interface{})

func FindIndex added in v1.1.0

func FindIndex(haystack []interface{}, needle interface{}) (int, error)

func FindString

func FindString(haystack []string, needle string) (int, bool)

func GetContainerByName added in v1.1.0

func GetContainerByName(containers []core.Container, name string) *core.Container

func GetRootLogger added in v1.1.0

func GetRootLogger(devMode bool) *zap.Logger

func HasPort added in v1.1.0

func HasPort(port string, ports []core.ServicePort) bool

func IsInOrder added in v1.1.0

func IsInOrder(list []interface{}, before interface{}, after interface{}) bool

func LabelsEqual added in v1.1.0

func LabelsEqual(target map[string]string, source map[string]string) bool

Return *true* if, for given source labels, the target label values exist and have the same value

func LabelsUpdate added in v1.1.0

func LabelsUpdate(target *map[string]string, source map[string]string)

func RemovePortFromContainer added in v1.1.0

func RemovePortFromContainer(container *core.Container, port *core.ContainerPort)

func RemovePortFromService added in v1.1.0

func RemovePortFromService(service *core.Service, port *core.ServicePort)

func RemoveRuleFromNetworkPolicy added in v1.1.0

func RemoveRuleFromNetworkPolicy(policy *networking.NetworkPolicy, rule *networking.NetworkPolicyIngressRule)

func RemoveVolumeFromDeployment added in v1.1.0

func RemoveVolumeFromDeployment(deployment *apps.Deployment, volume *core.Volume)

func RemoveVolumeMountFromContainer added in v1.1.0

func RemoveVolumeMountFromContainer(container *core.Container, volumeMount *core.VolumeMount)

func SecretHasField added in v1.1.0

func SecretHasField(secret *core.Secret, field string) bool

func SetVolume added in v1.1.0

func SetVolume(volumes *[]core.Volume, volume *core.Volume)

func SetVolumeInDeployment added in v1.1.0

func SetVolumeInDeployment(deployment *apps.Deployment, volume *core.Volume)

TODO Refactor

func SetVolumeMount added in v1.1.0

func SetVolumeMount(volumeMounts *[]core.VolumeMount, volumeMount *core.VolumeMount)

Types

type Name

type Name string

func (Name) Str

func (s Name) Str() string

type Namespace

type Namespace string

func (Namespace) Str

func (s Namespace) Str() string

type SupportedFeatures added in v1.1.0

type SupportedFeatures struct {
	IsOCP               bool
	SupportsPDBv1       bool
	SupportsPDBv1beta1  bool
	PreferredPDBVersion string
	SupportsMonitoring  bool
}

type TestSupport added in v1.1.0

type TestSupport struct {
	// contains filtered or unexported fields
}

func NewTestSupport added in v1.1.0

func NewTestSupport(rootLog *zap.Logger, enabled bool) *TestSupport

func (*TestSupport) GetMockCanMakeHTTPRequestToOperand added in v1.1.0

func (this *TestSupport) GetMockCanMakeHTTPRequestToOperand(namespace string) bool

func (*TestSupport) GetMockOperandMetricsReportReady added in v1.1.0

func (this *TestSupport) GetMockOperandMetricsReportReady(namespace string) bool

func (*TestSupport) GetSupportedFeatures added in v1.1.0

func (this *TestSupport) GetSupportedFeatures() *SupportedFeatures

func (*TestSupport) IsEnabled added in v1.1.0

func (this *TestSupport) IsEnabled() bool

func (*TestSupport) ResetTimer added in v1.1.0

func (this *TestSupport) ResetTimer(namespace string)

func (*TestSupport) SetMockCanMakeHTTPRequestToOperand added in v1.1.0

func (this *TestSupport) SetMockCanMakeHTTPRequestToOperand(namespace string, value bool)

func (*TestSupport) SetMockOperandMetricsReportReady added in v1.1.0

func (this *TestSupport) SetMockOperandMetricsReportReady(namespace string, value bool)

func (*TestSupport) SetSupportedFeatures added in v1.1.0

func (this *TestSupport) SetSupportedFeatures(features *SupportedFeatures)

func (*TestSupport) TimerDuration added in v1.1.0

func (this *TestSupport) TimerDuration(namespace string) time.Duration

Jump to

Keyboard shortcuts

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