test

package
v0.0.0-...-1f90625 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name                   = "test"
	OperandNamespace       = "external-dns"
	OperandName            = "external-dns-test"
	OperandImage           = "quay.io/test/external-dns:latest"
	OperatorNamespace      = "external-dns-operator"
	OperandSecretName      = "external-dns-credentials-test"
	PublicZone             = "my-dns-public-zone"
	PrivateZone            = "my-dns-private-zone"
	AzurePrivateDNSZone    = "/subscriptions/xxxx/resourceGroups/test-az-2f9kj-rg/providers/Microsoft.Network/privateDnsZones/test-az.example.com"
	TrustedCAConfigMapName = "external-dns-trusted-ca"
)

Variables

View Source
var (
	TrueVar     = true
	ExternalDNS = &operatorv1beta1.ExternalDNS{
		ObjectMeta: metav1.ObjectMeta{
			Name: Name,
		},
	}
	Scheme = runtime.NewScheme()
)

Functions

func IndexEvents

func IndexEvents(events []Event) map[string]Event

IndexEvents turns the slice of events into a map for the more convenient lookups.

Types

type Event

type Event struct {
	EventType watch.EventType
	ObjType   string
	types.NamespacedName
}

Event is a simplified representation of the watch event received from the controller runtime client.

func NewEvent

func NewEvent(we watch.Event) Event

NewEvent returns an event instance created from the controller runtime's watch event.

func (Event) Key

func (e Event) Key() string

Key returns a key like representation of the event.

type EventCollector

type EventCollector struct {
	T          *testing.T
	Client     client.WithWatch
	WatchTypes []client.ObjectList
	Verbose    bool
	// contains filtered or unexported fields
}

EventCollector collects all types of events for the given watch types.

func NewEventCollector

func NewEventCollector(t *testing.T, client client.WithWatch, watchTypes []client.ObjectList, bufSize int) *EventCollector

NewEventCollector returns an instance of the event collector.

func (*EventCollector) Collect

func (c *EventCollector) Collect(num int, timeout time.Duration) []Event

Collect collects events until the given number is reached or until the timeout is expired.

func (*EventCollector) Start

func (c *EventCollector) Start(ctx context.Context)

Start starts watches for all the watch types.

func (*EventCollector) Stop

func (c *EventCollector) Stop()

Stop stops all the watches.

type ExternalDNSBuilder

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

func NewExternalDNS

func NewExternalDNS(name string) *ExternalDNSBuilder

func (*ExternalDNSBuilder) Build

func (*ExternalDNSBuilder) WithAWS

func (b *ExternalDNSBuilder) WithAWS() *ExternalDNSBuilder

func (*ExternalDNSBuilder) WithAzure

func (b *ExternalDNSBuilder) WithAzure() *ExternalDNSBuilder

func (*ExternalDNSBuilder) WithGCP

func (b *ExternalDNSBuilder) WithGCP() *ExternalDNSBuilder

func (*ExternalDNSBuilder) WithProviderType

func (*ExternalDNSBuilder) WithRouteSource

func (b *ExternalDNSBuilder) WithRouteSource() *ExternalDNSBuilder

func (*ExternalDNSBuilder) WithServiceSource

func (b *ExternalDNSBuilder) WithServiceSource() *ExternalDNSBuilder

func (*ExternalDNSBuilder) WithSourceType

func (*ExternalDNSBuilder) WithZones

func (b *ExternalDNSBuilder) WithZones(ids ...string) *ExternalDNSBuilder

Jump to

Keyboard shortcuts

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