infra

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Infras = infras{
	{
		Name:          "basic-cluster",
		ResourceGroup: uniqueResourceGroup(),
		Location:      getLocation(),
		Suffix:        uuid.New().String(),
	},
	{
		Name:          "private-cluster",
		ResourceGroup: uniqueResourceGroup(),
		Location:      getLocation(),
		Suffix:        uuid.New().String(),
		McOpts:        []clients.McOpt{clients.PrivateClusterOpt},
	},
	{
		Name:          "osm-cluster",
		ResourceGroup: uniqueResourceGroup(),
		Location:      getLocation(),
		Suffix:        uuid.New().String(),
		McOpts:        []clients.McOpt{clients.OsmClusterOpt, clients.VmCountOpt(7)},
	},
}

Infras is a list of infrastructure configurations the e2e tests will run against

Functions

func Deploy

func Deploy(p []Provisioned) error

Types

type AuthType

type AuthType string
const (
	AuthTypeManagedIdentity  AuthType = "" // MSI is the default
	AuthTypeServicePrincipal AuthType = "servicePrincipal"
)

type Identifier

type Identifier interface {
	GetId() string
}

type LoadableProvisioned

type LoadableProvisioned struct {
	Name                                                                      string
	Cluster                                                                   azure.Resource
	ClusterLocation, ClusterDnsServiceIp, ClusterPrincipalId, ClusterClientId string
	ClusterOptions                                                            map[string]struct{}
	ContainerRegistry                                                         azure.Resource
	Zones                                                                     []withLoadableCert[LoadableZone]
	PrivateZones                                                              []withLoadableCert[azure.Resource]
	KeyVault                                                                  azure.Resource
	ResourceGroup                                                             arm.ResourceID // rg id is a little weird and can't be correctly parsed by azure.Resource so we have to use arm.ResourceID
	SubscriptionId                                                            string
	TenantId                                                                  string
	E2eImage                                                                  string
	OperatorImage                                                             string
}

LoadableProvisioned is a struct that can be used to load a Provisioned struct from a file. Ensure that all fields are exported so that they can properly be serialized/deserialized.

func ToLoadable

func ToLoadable(p []Provisioned) ([]LoadableProvisioned, error)

func (LoadableProvisioned) Provisioned

func (l LoadableProvisioned) Provisioned() (Provisioned, error)

type LoadableZone

type LoadableZone struct {
	ResourceId  azure.Resource
	Nameservers []string
}

type PrivateZone

type PrivateZone interface {
	GetDnsZone(ctx context.Context) (*armprivatedns.PrivateZone, error)
	LinkVnet(ctx context.Context, linkName, vnetId string) error
	GetName() string
	Identifier
}

type Provisioned

type Provisioned struct {
	Name              string
	Cluster           cluster
	ContainerRegistry containerRegistry
	Zones             []WithCert[Zone]
	PrivateZones      []WithCert[PrivateZone]
	KeyVault          keyVault
	ResourceGroup     resourceGroup
	SubscriptionId    string
	TenantId          string
	E2eImage          string
	OperatorImage     string
}

func ToProvisioned

func ToProvisioned(l []LoadableProvisioned) ([]Provisioned, error)

func (Provisioned) Cleanup

func (p Provisioned) Cleanup(ctx context.Context) error

func (Provisioned) Deploy

func (p Provisioned) Deploy(ctx context.Context) error

func (Provisioned) Loadable

func (p Provisioned) Loadable() (LoadableProvisioned, error)

type WithCert

type WithCert[T any] struct {
	Zone T
	Cert cert
}

WithCert is a resource with a tls certificate valid for that resource. This is used to bundle DNS Zones

type Zone

type Zone interface {
	GetDnsZone(ctx context.Context) (*armdns.Zone, error)
	GetName() string
	GetNameservers() []string
	Identifier
}

Jump to

Keyboard shortcuts

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