config

package
v0.22.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	STATE_DELETED = "~DELETED~"
)

Variables

This section is empty.

Functions

func PrintConfigEnv

func PrintConfigEnv()

func RandStringBytes

func RandStringBytes(n int) string

Types

type CheckFunc

type CheckFunc func() (bool, error)

type Config

type Config struct {
	Providers []*ProviderConfig `json:"providers"`

	KubeConfig string
	Namespace  string
	DNSLookup  bool
	Utils      *TestUtils
}

func InitConfig

func InitConfig() *Config

func LoadConfig

func LoadConfig(filename string) (*Config, error)

type LookupFunc

type LookupFunc func(dnsname string) ([]string, error)

type ProviderConfig

type ProviderConfig struct {
	Name                 string                              `json:"name"`
	Type                 string                              `json:"type"`
	FinalizerType        string                              `json:"finalizerType,omitempty"`
	Domain               string                              `json:"domain"`
	ForeignDomain        string                              `json:"foreignDomain,omitempty"`
	SecretData           string                              `json:"secretData"`
	Prefix               string                              `json:"prefix"`
	AliasTarget          string                              `json:"aliasTarget,omitempty"`
	AliasTargetDualStack string                              `json:"aliasTargetDualStack,omitempty"`
	ZoneID               string                              `json:"zoneID"`
	PrivateDNS           bool                                `json:"privateDNS,omitempty"`
	TTL                  string                              `json:"ttl,omitempty"`
	SpecProviderConfig   string                              `json:"providerConfig,omitempty"`
	RoutingPolicySets    map[string]map[string]RoutingPolicy `json:"routingPolicySets,omitempty"`

	Namespace string
}

func (*ProviderConfig) CreateTempManifest

func (p *ProviderConfig) CreateTempManifest(basePath, testName string, manifestTemplate *template.Template) (string, error)

func (*ProviderConfig) DeleteTempManifest

func (p *ProviderConfig) DeleteTempManifest(manifestFilename string)

func (*ProviderConfig) TTLValue

func (p *ProviderConfig) TTLValue() int

type RoutingPolicy added in v0.13.0

type RoutingPolicy struct {
	Type       string            `json:"type"`
	Parameters map[string]string `json:"parameters"`
	Targets    []string          `json:"targets"`
}

type TestUtils

type TestUtils struct {
	AwaitTimeout  time.Duration
	LookupTimeout time.Duration
	PollingPeriod time.Duration
	Namespace     string
	Verbose       bool
	// contains filtered or unexported fields
}

func CreateDefaultTestUtils

func CreateDefaultTestUtils(dnsServer string) *TestUtils

func (*TestUtils) Await

func (u *TestUtils) Await(msg string, check CheckFunc) error

func (*TestUtils) AwaitDNSEntriesDeleted

func (u *TestUtils) AwaitDNSEntriesDeleted(names ...string) error

func (*TestUtils) AwaitDNSEntriesError

func (u *TestUtils) AwaitDNSEntriesError(names ...string) error

func (*TestUtils) AwaitDNSEntriesReady

func (u *TestUtils) AwaitDNSEntriesReady(names ...string) error

func (*TestUtils) AwaitDNSProviderDeleted

func (u *TestUtils) AwaitDNSProviderDeleted(names ...string) error

func (*TestUtils) AwaitDNSProviderReady

func (u *TestUtils) AwaitDNSProviderReady(names ...string) error

func (*TestUtils) AwaitKubectlGetCRDs

func (u *TestUtils) AwaitKubectlGetCRDs(crds ...string) error

func (*TestUtils) AwaitLookup

func (u *TestUtils) AwaitLookup(dnsname string, expected ...string)

func (*TestUtils) AwaitLookupCName

func (u *TestUtils) AwaitLookupCName(dnsname, target string)

func (*TestUtils) AwaitLookupFunc

func (u *TestUtils) AwaitLookupFunc(lookup LookupFunc, dnsname string, expected ...string)

func (*TestUtils) AwaitLookupTXT

func (u *TestUtils) AwaitLookupTXT(dnsname string, expected ...string)

func (*TestUtils) AwaitState

func (u *TestUtils) AwaitState(resourceName, expectedState string, names ...string) error

func (*TestUtils) AwaitWithTimeout

func (u *TestUtils) AwaitWithTimeout(msg string, check CheckFunc, timeout time.Duration) error

func (*TestUtils) CanLookup

func (u *TestUtils) CanLookup(privateDNS bool) bool

func (*TestUtils) KubectlApply

func (u *TestUtils) KubectlApply(filename string) error

func (*TestUtils) KubectlDelete

func (u *TestUtils) KubectlDelete(filename string) error

func (*TestUtils) KubectlGetAllDNSEntries

func (u *TestUtils) KubectlGetAllDNSEntries() (map[string]interface{}, error)

func (*TestUtils) LogVerbose

func (u *TestUtils) LogVerbose(output string)

func (*TestUtils) SetTimeoutForNextAwait added in v0.7.20

func (u *TestUtils) SetTimeoutForNextAwait(timeout time.Duration)

Jump to

Keyboard shortcuts

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