test

package
v0.0.0-...-380b840 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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Used to map between alert and notification
	TestNotificationName = "test-notification"
)

Variables

View Source
var (
	Context              = context.TODO()
	Scheme               = setScheme(runtime.NewScheme())
	TestManagedClusterID = "test-managed-cluster-id"
	TestHostedClusterID  = "test-hosted-cluster-id"
	TestNotification     = ocmagentv1alpha1.Notification{
		Name:         TestNotificationName,
		Summary:      "test-summary [namespace: '${namespace}']",
		ActiveDesc:   "test-active-desc [description: '${description}', overriden-key: '${overriden-key}', recursive-key: '${recursive-key}']",
		ResolvedDesc: "test-resolved-desc [description: '${description}', overriden-key: '${overriden-key}']",
		Severity:     "test-severity",
		ResendWait:   1,
		LogType:      "test-type",
		References: []ocmagentv1alpha1.NotificationReferenceType{
			"http://some.awesome.com/reference",
			"https://another.great.com/resource",
		},
	}
	ServiceLogSummary               = "test-summary [namespace: 'openshift-monitoring']"
	ServiceLogActiveDesc            = "test-active-desc [description: 'alert-desc', overriden-key: 'label-value', recursive-key: '_${recursive-key}_']"
	ServiceLogResolvedDesc          = "test-resolved-desc [description: 'alert-desc', overriden-key: 'label-value']"
	ServiceLogFleetDesc             = "test-notification [description: 'alert-desc', overriden-key: 'label-value']"
	NotificationWithoutResolvedBody = ocmagentv1alpha1.Notification{
		Name:       TestNotificationName,
		Summary:    "test-summary",
		ActiveDesc: "test-active-desc",
		Severity:   "test-severity",
		ResendWait: 1,
	}
	TestNotificationRecord = ocmagentv1alpha1.NotificationRecord{
		Name:                TestNotificationName,
		ServiceLogSentCount: 0,
		Conditions: []ocmagentv1alpha1.NotificationCondition{
			{
				Type:   ocmagentv1alpha1.ConditionAlertFiring,
				Status: corev1.ConditionTrue,
			},
			{
				Type:   ocmagentv1alpha1.ConditionAlertResolved,
				Status: corev1.ConditionFalse,
			},
			{
				Type:   ocmagentv1alpha1.ConditionServiceLogSent,
				Status: corev1.ConditionTrue,
			},
		},
	}
	TestManagedNotification = ocmagentv1alpha1.ManagedNotification{
		ObjectMeta: metav1.ObjectMeta{
			Name:      "test-mn",
			Namespace: "openshift-ocm-agent-operator",
		},
		Spec: ocmagentv1alpha1.ManagedNotificationSpec{
			Notifications: []ocmagentv1alpha1.Notification{TestNotification},
		},
		Status: ocmagentv1alpha1.ManagedNotificationStatus{
			NotificationRecords: ocmagentv1alpha1.NotificationRecords{
				TestNotificationRecord,
			},
		},
	}
	TestManagedNotificationWithoutStatus = ocmagentv1alpha1.ManagedNotification{
		ObjectMeta: metav1.ObjectMeta{
			Name:      "test-mn",
			Namespace: "openshift-ocm-agent-operator",
		},
		Spec: ocmagentv1alpha1.ManagedNotificationSpec{
			Notifications: []ocmagentv1alpha1.Notification{TestNotification},
		},
	}
	TestManagedNotificationList = &ocmagentv1alpha1.ManagedNotificationList{
		Items: []ocmagentv1alpha1.ManagedNotification{
			TestManagedNotification,
		},
	}
)

Functions

func NewFleetNotification

func NewFleetNotification() ocmagentv1alpha1.FleetNotification

func NewManagedFleetNotification

func NewManagedFleetNotification(limited_support bool) ocmagentv1alpha1.ManagedFleetNotification

func NewManagedFleetNotificationRecordWithStatus

func NewManagedFleetNotificationRecordWithStatus() ocmagentv1alpha1.ManagedFleetNotificationRecord

func NewTestAlert

func NewTestAlert(resolved bool, fleet bool) template.Alert

func NewTestServiceLog

func NewTestServiceLog(summary, desc, clusterUUID string, severity ocmagentv1alpha1.NotificationSeverity, logType string, references []ocmagentv1alpha1.NotificationReferenceType) *slv1.LogEntry

Types

This section is empty.

Jump to

Keyboard shortcuts

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