provider

package
v0.9.18 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MIT Imports: 70 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PreflightCheckEnabledServices           = PreflightCheck("[User] Enabled Services")
	PreflightCheckServiceAccountPermissions = PreflightCheck("[User] Test Permissions")
)
View Source
const (
	ZoneLabel = "topology.gke.io/zone"
)

Variables

This section is empty.

Functions

func GetAwsAccount

func GetAwsAccount(ctx context.Context) (string, error)

func GetAzureAccount

func GetAzureAccount() (string, string, error)

func GetProviderScaffold

func GetProviderScaffold(provider, version string) (string, error)

func IgnoreProviders added in v0.8.3

func IgnoreProviders(prov []string)

func MetalRetryPolicy

func MetalRetryPolicy(ctx context.Context, resp *http.Response, err error) (bool, error)

func SetCloudFlag added in v0.9.14

func SetCloudFlag(cloud bool)

Types

type AWSProvider

type AWSProvider struct {
	Clus string `survey:"cluster"`

	Reg string `survey:"region"`
	// contains filtered or unexported fields
}

func (*AWSProvider) Bucket

func (aws *AWSProvider) Bucket() string

func (*AWSProvider) Cluster

func (aws *AWSProvider) Cluster() string

func (*AWSProvider) Context

func (aws *AWSProvider) Context() map[string]interface{}

func (*AWSProvider) CreateBackend

func (aws *AWSProvider) CreateBackend(prefix string, version string, ctx map[string]interface{}) (string, error)

func (*AWSProvider) CreateBucket added in v0.8.3

func (aws *AWSProvider) CreateBucket() error

func (*AWSProvider) Decommision

func (prov *AWSProvider) Decommision(node *v1.Node) error

func (*AWSProvider) Flush

func (aws *AWSProvider) Flush() error

func (*AWSProvider) KubeConfig

func (aws *AWSProvider) KubeConfig() error

func (*AWSProvider) KubeContext

func (aws *AWSProvider) KubeContext() string

func (*AWSProvider) Name

func (aws *AWSProvider) Name() string

func (*AWSProvider) Permissions

func (prov *AWSProvider) Permissions() (permissions.Checker, error)

func (*AWSProvider) Preflights

func (aws *AWSProvider) Preflights() []*Preflight

func (*AWSProvider) Project

func (aws *AWSProvider) Project() string

func (*AWSProvider) Region

func (aws *AWSProvider) Region() string

type AzureProvider

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

func AzureFromManifest

func AzureFromManifest(man *manifest.ProjectManifest, clientSet *ClientSet) (*AzureProvider, error)

func (*AzureProvider) Bucket

func (az *AzureProvider) Bucket() string

func (*AzureProvider) Cluster

func (az *AzureProvider) Cluster() string

func (*AzureProvider) Context

func (az *AzureProvider) Context() map[string]interface{}

func (*AzureProvider) CreateBackend

func (az *AzureProvider) CreateBackend(prefix string, version string, ctx map[string]interface{}) (string, error)

func (*AzureProvider) CreateBucket

func (az *AzureProvider) CreateBucket() error

func (*AzureProvider) CreateResourceGroup

func (az *AzureProvider) CreateResourceGroup(resourceGroup string) error

func (*AzureProvider) Decommision

func (az *AzureProvider) Decommision(node *v1.Node) error

func (*AzureProvider) Flush

func (az *AzureProvider) Flush() error

func (*AzureProvider) KubeConfig

func (az *AzureProvider) KubeConfig() error

func (*AzureProvider) KubeContext

func (az *AzureProvider) KubeContext() string

func (*AzureProvider) Name

func (az *AzureProvider) Name() string

func (*AzureProvider) Permissions

func (*AzureProvider) Permissions() (permissions.Checker, error)

func (*AzureProvider) Preflights

func (az *AzureProvider) Preflights() []*Preflight

func (*AzureProvider) Project

func (az *AzureProvider) Project() string

func (*AzureProvider) Region

func (az *AzureProvider) Region() string

type BucketLocation

type BucketLocation string
const (
	BucketLocationUS   BucketLocation = "US"
	BucketLocationEU   BucketLocation = "EU"
	BucketLocationASIA BucketLocation = "ASIA"
)

type ClientSet

type ClientSet struct {
	Groups     ResourceGroupClient
	Accounts   AccountsClient
	Containers ContainerClient
}

func GetClientSet

func GetClientSet(subscriptionId string) (*ClientSet, error)

type ContainerClient

type ContainerClient interface {
	GetProperties(ctx context.Context, ac azblob.LeaseAccessConditions) (*azblob.ContainerGetPropertiesResponse, error)
	Create(ctx context.Context, metadata azblob.Metadata, publicAccessType azblob.PublicAccessType) (*azblob.ContainerCreateResponse, error)
}

type EQUINIXProvider

type EQUINIXProvider struct {
	Clust string `survey:"cluster"`
	Proj  string

	Metro string `survey:"metro"`
	// contains filtered or unexported fields
}

func (*EQUINIXProvider) Bucket

func (equinix *EQUINIXProvider) Bucket() string

func (*EQUINIXProvider) Cluster

func (equinix *EQUINIXProvider) Cluster() string

func (*EQUINIXProvider) Context

func (equinix *EQUINIXProvider) Context() map[string]interface{}

func (*EQUINIXProvider) CreateBackend

func (equinix *EQUINIXProvider) CreateBackend(prefix string, version string, ctx map[string]interface{}) (string, error)

func (*EQUINIXProvider) CreateBucket added in v0.8.3

func (equinix *EQUINIXProvider) CreateBucket() error

func (*EQUINIXProvider) Decommision

func (prov *EQUINIXProvider) Decommision(node *v1.Node) error

func (*EQUINIXProvider) Flush

func (equinix *EQUINIXProvider) Flush() error

func (*EQUINIXProvider) KubeConfig

func (equinix *EQUINIXProvider) KubeConfig() error

func (*EQUINIXProvider) KubeContext

func (equinix *EQUINIXProvider) KubeContext() string

func (*EQUINIXProvider) Name

func (equinix *EQUINIXProvider) Name() string

func (*EQUINIXProvider) Permissions

func (*EQUINIXProvider) Permissions() (permissions.Checker, error)

func (*EQUINIXProvider) Preflights

func (equinix *EQUINIXProvider) Preflights() []*Preflight

func (*EQUINIXProvider) Project

func (equinix *EQUINIXProvider) Project() string

func (*EQUINIXProvider) Region

func (equinix *EQUINIXProvider) Region() string

type GCPProvider

type GCPProvider struct {
	Clust string `survey:"cluster"`
	Proj  string `survey:"project"`

	Reg string `survey:"region"`
	// contains filtered or unexported fields
}

func (*GCPProvider) Bucket

func (gcp *GCPProvider) Bucket() string

func (*GCPProvider) Cluster

func (gcp *GCPProvider) Cluster() string

func (*GCPProvider) Context

func (gcp *GCPProvider) Context() map[string]interface{}

func (*GCPProvider) CreateBackend

func (gcp *GCPProvider) CreateBackend(prefix string, version string, ctx map[string]interface{}) (string, error)

func (*GCPProvider) CreateBucket added in v0.8.3

func (gcp *GCPProvider) CreateBucket() error

func (*GCPProvider) Decommision

func (gcp *GCPProvider) Decommision(node *v1.Node) error

func (*GCPProvider) Flush

func (gcp *GCPProvider) Flush() error

func (*GCPProvider) KubeConfig

func (gcp *GCPProvider) KubeConfig() error

func (*GCPProvider) KubeContext

func (gcp *GCPProvider) KubeContext() string

func (*GCPProvider) Name

func (gcp *GCPProvider) Name() string

func (*GCPProvider) Permissions

func (gcp *GCPProvider) Permissions() (permissions.Checker, error)

func (*GCPProvider) Preflights

func (gcp *GCPProvider) Preflights() []*Preflight

func (*GCPProvider) Project

func (gcp *GCPProvider) Project() string

func (*GCPProvider) Region

func (gcp *GCPProvider) Region() string

type KINDProvider

type KINDProvider struct {
	Clust string `survey:"cluster"`
	Proj  string

	Reg string
	// contains filtered or unexported fields
}

func (*KINDProvider) Bucket

func (kind *KINDProvider) Bucket() string

func (*KINDProvider) Cluster

func (kind *KINDProvider) Cluster() string

func (*KINDProvider) Context

func (kind *KINDProvider) Context() map[string]interface{}

func (*KINDProvider) CreateBackend

func (kind *KINDProvider) CreateBackend(prefix string, version string, ctx map[string]interface{}) (string, error)

func (*KINDProvider) CreateBucket added in v0.8.3

func (kind *KINDProvider) CreateBucket() error

func (*KINDProvider) Decommision

func (prov *KINDProvider) Decommision(node *v1.Node) error

func (*KINDProvider) Flush

func (kind *KINDProvider) Flush() error

func (*KINDProvider) KubeConfig

func (kind *KINDProvider) KubeConfig() error

func (*KINDProvider) KubeContext

func (kind *KINDProvider) KubeContext() string

func (*KINDProvider) Name

func (kind *KINDProvider) Name() string

func (*KINDProvider) Permissions

func (*KINDProvider) Permissions() (permissions.Checker, error)

func (*KINDProvider) Preflights

func (prov *KINDProvider) Preflights() []*Preflight

func (*KINDProvider) Project

func (kind *KINDProvider) Project() string

func (*KINDProvider) Region

func (kind *KINDProvider) Region() string

type LinodeProvider added in v0.8.3

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

func (*LinodeProvider) Bucket added in v0.8.3

func (l *LinodeProvider) Bucket() string

func (*LinodeProvider) Cluster added in v0.8.3

func (l *LinodeProvider) Cluster() string

func (*LinodeProvider) Context added in v0.8.3

func (l *LinodeProvider) Context() map[string]interface{}

func (*LinodeProvider) CreateBackend added in v0.8.3

func (l *LinodeProvider) CreateBackend(prefix string, version string, ctx map[string]interface{}) (string, error)

func (*LinodeProvider) CreateBucket added in v0.8.3

func (l *LinodeProvider) CreateBucket() error

func (*LinodeProvider) Decommision added in v0.8.3

func (l *LinodeProvider) Decommision(node *v1.Node) error

func (*LinodeProvider) Flush added in v0.8.3

func (l *LinodeProvider) Flush() error

func (*LinodeProvider) KubeConfig added in v0.8.3

func (l *LinodeProvider) KubeConfig() error

func (*LinodeProvider) KubeContext added in v0.8.3

func (l *LinodeProvider) KubeContext() string

func (*LinodeProvider) Name added in v0.8.3

func (l *LinodeProvider) Name() string

func (*LinodeProvider) Permissions added in v0.8.3

func (*LinodeProvider) Permissions() (permissions.Checker, error)

func (*LinodeProvider) Preflights added in v0.8.3

func (l *LinodeProvider) Preflights() []*Preflight

func (*LinodeProvider) Project added in v0.8.3

func (l *LinodeProvider) Project() string

func (*LinodeProvider) Region added in v0.8.3

func (l *LinodeProvider) Region() string

type Preflight

type Preflight struct {
	Name     string
	Callback func() error
}

func (*Preflight) Validate

func (pf *Preflight) Validate() error

type PreflightCheck

type PreflightCheck string

type Provider

type Provider interface {
	Name() string
	Cluster() string
	Project() string
	Region() string
	Bucket() string
	KubeConfig() error
	KubeContext() string
	CreateBackend(prefix string, version string, ctx map[string]interface{}) (string, error)
	CreateBucket() error
	Context() map[string]interface{}
	Decommision(node *v1.Node) error
	Preflights() []*Preflight
	Permissions() (permissions.Checker, error)
	Flush() error
}

func FromManifest

func FromManifest(man *manifest.ProjectManifest) (Provider, error)

func GetProvider

func GetProvider() (Provider, error)

func New

func New(provider string) (Provider, error)

type Providers

type Providers struct {
	AvailableProviders []string
	Scaffolds          map[string]string
}

type ResourceGroupClient

ResourceGroupClient is the subset of functions we need from armresources.VirtualResourceGroupsClient; this interface is purely here for allowing unit tests.

type TestProvider

type TestProvider struct {
	Clust string `survey:"cluster"`
	Proj  string

	Reg string
	// contains filtered or unexported fields
}

func (TestProvider) Bucket

func (t TestProvider) Bucket() string

func (TestProvider) Cluster

func (t TestProvider) Cluster() string

func (TestProvider) Context

func (t TestProvider) Context() map[string]interface{}

func (TestProvider) CreateBackend

func (t TestProvider) CreateBackend(prefix string, version string, ctx map[string]interface{}) (string, error)

func (TestProvider) CreateBucket added in v0.8.3

func (t TestProvider) CreateBucket() error

func (TestProvider) Decommision

func (t TestProvider) Decommision(_ *corev1.Node) error

func (TestProvider) Flush

func (t TestProvider) Flush() error

func (TestProvider) KubeConfig

func (t TestProvider) KubeConfig() error

func (TestProvider) KubeContext

func (t TestProvider) KubeContext() string

func (TestProvider) Name

func (t TestProvider) Name() string

func (TestProvider) Permissions

func (t TestProvider) Permissions() (permissions.Checker, error)

func (TestProvider) Preflights

func (t TestProvider) Preflights() []*Preflight

func (TestProvider) Project

func (t TestProvider) Project() string

func (TestProvider) Region

func (t TestProvider) Region() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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