Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateOperatorPodStability() error
- func CheckAvailableEvent(gvk schema.GroupVersionKind)
- func CheckComponentsDeployment(components []Component)
- func CheckComponentsRemoval(components []Component)
- func CheckConfigCondition(gvk schema.GroupVersionKind, conditionType ConditionType, ...)
- func CheckConfigVersions(gvk schema.GroupVersionKind, ...)
- func CheckCrdExplainable()
- func CheckFailedEvent(gvk schema.GroupVersionKind, reason string)
- func CheckForGenericDeployment(name, namespace string, checkVersionLabels, checkRelationshipLabels bool) error
- func CheckForLeftoverLabels()
- func CheckForLeftoverObjects(currentVersion string)
- func CheckModifiedEvent(gvk schema.GroupVersionKind)
- func CheckNoWarningEvents(gvk schema.GroupVersionKind, rv string)
- func CheckOperatorIsReady(timeout time.Duration)
- func CheckOperatorPodStability(continuesDuration time.Duration)
- func CheckProgressingEvent(gvk schema.GroupVersionKind)
- func CheckUnicastAndValidity() (string, string)
- func FindMetric(metrics string, expectedMetric string) string
- func GetEnvVarsFromDeployment(deploymentName string) ([]corev1.EnvVar, error)
- func GetMonitoringEndpoint() (*corev1.EndpointAddress, int32, error)
- func KeepCheckingWhile(check func(), while func())
- func PlacementListFromComponentDaemonSets(component Component) ([]cnao.Placement, error)
- func PrintOperatorPodStability()
- func ScrapeEndpointAddress(epAddress *corev1.EndpointAddress, epPort int32) (string, error)
- type Component
- type ComponentSource
- type ComponentUpdatePolicy
- type ComponentsConfig
- type ConditionStatus
- type ConditionType
- type EventType
- type ObjectEventWatcher
- func (w *ObjectEventWatcher) FailOnWarnings() *ObjectEventWatcher
- func (w *ObjectEventWatcher) SinceNow() *ObjectEventWatcher
- func (w *ObjectEventWatcher) SinceObjectResourceVersion(object runtime.Object) *ObjectEventWatcher
- func (w *ObjectEventWatcher) SinceResourceVersion(rv string) *ObjectEventWatcher
- func (w *ObjectEventWatcher) SinceWatchedObjectResourceVersion() *ObjectEventWatcher
- func (w *ObjectEventWatcher) Timeout(duration time.Duration) *ObjectEventWatcher
- func (w *ObjectEventWatcher) WaitFor(stopChan chan struct{}, eventType EventType, reason interface{}) (e *corev1.Event)
- func (w *ObjectEventWatcher) WaitNotFor(stopChan chan struct{}, eventType EventType, reason interface{}) (e *corev1.Event)
- func (w *ObjectEventWatcher) WaitNotForType(stopChan chan struct{}, eventType EventType) (e *corev1.Event)
- func (w *ObjectEventWatcher) Watch(abortChan chan struct{}, processFunc ProcessFunc, watchedDescription string)
- type ProcessFunc
Constants ¶
const ( CheckImmediately = time.Microsecond CheckDoNotRepeat = time.Microsecond CheckIgnoreVersion = "IGNORE" )
const ( ConditionAvailable = ConditionType(conditionsv1.ConditionAvailable) ConditionProgressing = ConditionType(conditionsv1.ConditionProgressing) ConditionDegraded = ConditionType(conditionsv1.ConditionDegraded) ConditionTrue = ConditionStatus(corev1.ConditionTrue) ConditionFalse = ConditionStatus(corev1.ConditionFalse) )
Variables ¶
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", } AllComponents = []Component{ KubeMacPoolComponent, LinuxBridgeComponent, MultusComponent, OvsComponent, MacvtapComponent, MonitoringComponent, } )
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 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 CheckOperatorPodStability ¶ added in v0.42.1
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 ¶
CheckUnicast return an error in case that the given addresses support multicast or is invalid.
func FindMetric ¶ added in v0.58.0
func GetEnvVarsFromDeployment ¶ added in v0.50.0
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 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 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 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)