check

package
v0.93.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CheckImmediately   = time.Microsecond
	CheckDoNotRepeat   = time.Microsecond
	CheckIgnoreVersion = "IGNORE"
)

Variables

View Source
var (
	KubeMacPoolComponent = Component{
		ComponentName:                "KubeMacPool",
		ClusterRole:                  "kubemacpool-manager-role",
		ClusterRoleBinding:           "kubemacpool-manager-rolebinding",
		Deployments:                  []string{"kubemacpool-mac-controller-manager", "kubemacpool-cert-manager"},
		MutatingWebhookConfiguration: "kubemacpool-mutator",
	}
	LinuxBridgeComponent = Component{
		ComponentName:              "Linux Bridge",
		ClusterRole:                "bridge-marker-cr",
		ClusterRoleBinding:         "bridge-marker-crb",
		SecurityContextConstraints: "linux-bridge",
		ServiceMonitor:             "",
		DaemonSets: []string{
			"bridge-marker",
			"kube-cni-linux-bridge-plugin",
		},
	}
	MultusComponent = Component{
		ComponentName:              "Multus",
		ClusterRole:                "multus",
		ClusterRoleBinding:         "multus",
		SecurityContextConstraints: "multus",
		DaemonSets:                 []string{"multus"},
	}
	OvsComponent = Component{
		ComponentName:              "Ovs",
		ClusterRole:                "ovs-cni-marker-cr",
		ClusterRoleBinding:         "ovs-cni-marker-crb",
		SecurityContextConstraints: "ovs-cni-marker",
		DaemonSets: []string{
			"ovs-cni-amd64",
		},
	}
	MacvtapComponent = Component{
		ComponentName:              "Macvtap",
		ClusterRole:                "",
		ClusterRoleBinding:         "",
		SecurityContextConstraints: "macvtap-cni",
		DaemonSets: []string{
			"macvtap-cni",
		},
	}
	MonitoringComponent = Component{
		ComponentName:  "Monitoring",
		Service:        "cluster-network-addons-operator-prometheus-metrics",
		ServiceMonitor: "service-monitor-cluster-network-addons-operator",
		PrometheusRule: "prometheus-rules-cluster-network-addons-operator",
	}
	MultusDynamicNetworks = Component{
		ClusterRole:        "dynamic-networks-controller",
		ClusterRoleBinding: "dynamic-networks-controller",
		ComponentName:      "Multus Dynamic Networks",
		DaemonSets: []string{
			"dynamic-networks-controller-ds",
		},
	}
	KubeSecondaryDNSComponent = Component{
		ComponentName:      "KubeSecondaryDNS",
		ClusterRole:        "secondary",
		ClusterRoleBinding: "secondary",
		Deployments:        []string{"secondary-dns"},
	}
	AllComponents = []Component{
		KubeMacPoolComponent,
		LinuxBridgeComponent,
		MultusComponent,
		OvsComponent,
		MacvtapComponent,
		MonitoringComponent,
		MultusDynamicNetworks,
		KubeSecondaryDNSComponent,
	}
)

Functions

func CalculateOperatorPodStability added in v0.42.1

func CalculateOperatorPodStability() error

func CheckAvailableEvent added in v0.42.0

func CheckAvailableEvent(gvk schema.GroupVersionKind)

func CheckComponentsDeployment

func CheckComponentsDeployment(components []Component)

func CheckComponentsRemoval

func CheckComponentsRemoval(components []Component)

func CheckConfigCondition

func CheckConfigCondition(gvk schema.GroupVersionKind, conditionType ConditionType, conditionStatus ConditionStatus, timeout time.Duration, duration time.Duration)

func CheckConfigVersions

func CheckConfigVersions(gvk schema.GroupVersionKind, operatorVersion, observedVersion, targetVersion string, timeout, duration time.Duration)

func CheckCrdExplainable added in v0.43.0

func CheckCrdExplainable()

func CheckFailedEvent added in v0.42.0

func CheckFailedEvent(gvk schema.GroupVersionKind, reason string)

func CheckForGenericDeployment added in v0.69.0

func CheckForGenericDeployment(name, namespace string, checkVersionLabels, checkRelationshipLabels bool) error

func CheckForLeftoverLabels added in v0.65.4

func CheckForLeftoverLabels()

func CheckForLeftoverObjects

func CheckForLeftoverObjects(currentVersion string)

func CheckModifiedEvent added in v0.42.0

func CheckModifiedEvent(gvk schema.GroupVersionKind)

func CheckNoWarningEvents added in v0.44.1

func CheckNoWarningEvents(gvk schema.GroupVersionKind, rv string)

func CheckOperatorIsReady

func CheckOperatorIsReady(timeout time.Duration)

func CheckOperatorPodStability added in v0.42.1

func CheckOperatorPodStability(continuesDuration time.Duration)

CheckOperatorPodStability makes sure that the CNAO pod has not restarted since it started working

func CheckProgressingEvent added in v0.42.0

func CheckProgressingEvent(gvk schema.GroupVersionKind)

func CheckUnicastAndValidity

func CheckUnicastAndValidity() (string, string)

CheckUnicast return an error in case that the given addresses support multicast or is invalid.

func FindMetric added in v0.58.0

func FindMetric(metrics string, expectedMetric string) string

func GetEnvVarsFromDeployment added in v0.50.0

func GetEnvVarsFromDeployment(deploymentName string) ([]corev1.EnvVar, error)

func GetMonitoringEndpoint added in v0.68.0

func GetMonitoringEndpoint() (*corev1.EndpointAddress, int32, error)

func KeepCheckingWhile

func KeepCheckingWhile(check func(), while func())

func PlacementListFromComponentDaemonSets added in v0.42.3

func PlacementListFromComponentDaemonSets(component Component) ([]cnao.Placement, error)

func PlacementListFromComponentDeployments added in v0.85.1

func PlacementListFromComponentDeployments(component Component) ([]cnao.Placement, error)

func PrintOperatorPodStability added in v0.42.1

func PrintOperatorPodStability()

func ScrapeEndpointAddress added in v0.68.0

func ScrapeEndpointAddress(epAddress *corev1.EndpointAddress, epPort int32) (string, error)

Types

type Component

type Component struct {
	ComponentName                string
	ClusterRole                  string
	ClusterRoleBinding           string
	SecurityContextConstraints   string
	DaemonSets                   []string
	Deployments                  []string
	Secret                       string
	MutatingWebhookConfiguration string
	Service                      string
	ServiceMonitor               string
	PrometheusRule               string
}

type ComponentSource added in v0.55.0

type ComponentSource struct {
	Url          string                `yaml:"url"`
	Commit       string                `yaml:"commit"`
	Branch       string                `yaml:"branch"`
	UpdatePolicy ComponentUpdatePolicy `yaml:"update-policy"`
	Metadata     string                `yaml:"metadata"`
}

func GetComponentSource added in v0.55.0

func GetComponentSource(component string) (ComponentSource, error)

type ComponentUpdatePolicy added in v0.55.0

type ComponentUpdatePolicy string
const (
	Tagged ComponentUpdatePolicy = "tagged"
	Static ComponentUpdatePolicy = "static"
	Latest ComponentUpdatePolicy = "latest"
)

type ComponentsConfig added in v0.55.0

type ComponentsConfig struct {
	Components map[string]ComponentSource `yaml:"components"`
}

type ConditionStatus

type ConditionStatus corev1.ConditionStatus

type ConditionType

type ConditionType conditionsv1.ConditionType

type EventType added in v0.42.0

type EventType string
const (
	NormalEvent  EventType = "Normal"
	WarningEvent EventType = "Warning"
)

type ObjectEventWatcher added in v0.42.0

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

func NewObjectEventWatcher added in v0.42.0

func NewObjectEventWatcher(object runtime.Object) *ObjectEventWatcher

func (*ObjectEventWatcher) FailOnWarnings added in v0.42.0

func (w *ObjectEventWatcher) FailOnWarnings() *ObjectEventWatcher

func (*ObjectEventWatcher) SinceNow added in v0.42.0

func (w *ObjectEventWatcher) SinceNow() *ObjectEventWatcher

SinceNow sets a watch starting point for events, from the moment on the connection to the apiserver was established.

func (*ObjectEventWatcher) SinceObjectResourceVersion added in v0.42.0

func (w *ObjectEventWatcher) SinceObjectResourceVersion(object runtime.Object) *ObjectEventWatcher

SinceObjectResourceVersion takes the resource version of the passed in runtime object and takes it as the starting point for all events to watch for.

func (*ObjectEventWatcher) SinceResourceVersion added in v0.42.0

func (w *ObjectEventWatcher) SinceResourceVersion(rv string) *ObjectEventWatcher

SinceResourceVersion sets the passed in resourceVersion as the starting point for all events to watch for.

func (*ObjectEventWatcher) SinceWatchedObjectResourceVersion added in v0.42.0

func (w *ObjectEventWatcher) SinceWatchedObjectResourceVersion() *ObjectEventWatcher

SinceWatchedObjectResourceVersion takes the resource version of the runtime object which is watched, and takes it as the starting point for all events to watch for.

func (*ObjectEventWatcher) Timeout added in v0.42.0

func (w *ObjectEventWatcher) Timeout(duration time.Duration) *ObjectEventWatcher

func (*ObjectEventWatcher) WaitFor added in v0.42.0

func (w *ObjectEventWatcher) WaitFor(stopChan chan struct{}, eventType EventType, reason interface{}) (e *corev1.Event)

func (*ObjectEventWatcher) WaitNotFor added in v0.42.0

func (w *ObjectEventWatcher) WaitNotFor(stopChan chan struct{}, eventType EventType, reason interface{}) (e *corev1.Event)

func (*ObjectEventWatcher) WaitNotForType added in v0.44.1

func (w *ObjectEventWatcher) WaitNotForType(stopChan chan struct{}, eventType EventType) (e *corev1.Event)

func (*ObjectEventWatcher) Watch added in v0.42.0

func (w *ObjectEventWatcher) Watch(abortChan chan struct{}, processFunc ProcessFunc, watchedDescription string)

type ProcessFunc added in v0.42.0

type ProcessFunc func(event *corev1.Event) (done bool)

Jump to

Keyboard shortcuts

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