framework

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: Apache-2.0 Imports: 25 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthorities

func GetAuthorities(params *VBVParams) ([]versionbundle.Authority, error)

func GetVersionBundleVersion

func GetVersionBundleVersion(params *VBVParams) (string, error)

func IsClusterDeletion

func IsClusterDeletion(err error) bool

IsClusterDeletion asserts clusterDeletionError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsMissingVaultToken

func IsMissingVaultToken(err error) bool

IsMissingVaultToken asserts missingVaultTokenError.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

func IsTooManyResults

func IsTooManyResults(err error) bool

IsTooManyResults asserts invalidConfigError.

func IsUnexpectedStatusPhase

func IsUnexpectedStatusPhase(err error) bool

IsUnexpectedStatusPhase asserts notFoundError.

func IsUnknownProvider

func IsUnknownProvider(err error) bool

IsUnknownProvider asserts unknownProviderError.

func IsWait

func IsWait(err error) bool

IsWait asserts waitError.

func IsWaitTimeout

func IsWaitTimeout(err error) bool

IsWaitTimeout asserts waitTimeoutError.

Types

type Guest

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

func NewGuest

func NewGuest(config GuestConfig) (*Guest, error)

func (*Guest) EnsureNamespacesExists

func (g *Guest) EnsureNamespacesExists(ctx context.Context, namespaces []string) error

func (*Guest) G8sClient

func (g *Guest) G8sClient() versioned.Interface

G8sClient returns the guest cluster framework's apiextensions clientset. The client being returned is properly configured once Guest.Setup() is executed successfully.

func (*Guest) Initialize

func (g *Guest) Initialize() error

Initialize sets up the Guest fields that are not directly injected.

func (*Guest) K8sClient

func (g *Guest) K8sClient() kubernetes.Interface

K8sClient returns the guest cluster framework's Kubernetes client. The client being returned is properly configured once Guest.Setup() is executed successfully.

func (*Guest) RestConfig

func (g *Guest) RestConfig() *rest.Config

RestConfig returns the guest cluster framework's rest config. The config being returned is properly configured once Guest.Setup() is executed successfully.

func (*Guest) Setup

func (g *Guest) Setup(ctx context.Context) error

Setup provides a separate initialization step because of the nature of the host/guest cluster design. We have to setup things in different stages. Constructing the frameworks can be done right away but setting them up can only happen as soon as certain requirements have been met. A requirement for the guest framework is a set up host cluster.

func (*Guest) WaitForAPIDown

func (g *Guest) WaitForAPIDown() error

func (*Guest) WaitForAPIUp

func (g *Guest) WaitForAPIUp() error

func (*Guest) WaitForGuestReady

func (g *Guest) WaitForGuestReady(ctx context.Context) error

func (*Guest) WaitForNodesReady

func (g *Guest) WaitForNodesReady(ctx context.Context, expectedNodes int) error

type GuestConfig

type GuestConfig struct {
	Logger micrologger.Logger

	HostK8sClient kubernetes.Interface

	ClusterID    string
	CommonDomain string
}

type Host

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

func NewHost

func NewHost(c HostConfig) (*Host, error)

func (*Host) AWSCluster

func (h *Host) AWSCluster(name string) (*v1alpha1.AWSConfig, error)

func (*Host) ApplyAWSConfigPatch

func (h *Host) ApplyAWSConfigPatch(patch []PatchSpec, clusterName string) error

func (*Host) DeleteGuestCluster

func (h *Host) DeleteGuestCluster(ctx context.Context, provider string) error

func (*Host) ExtClient

func (h *Host) ExtClient() apiextensionsclient.Interface

func (*Host) G8sClient

func (h *Host) G8sClient() versioned.Interface

G8sClient returns the host cluster framework's Giant Swarm client.

func (*Host) K8sAggregationClient

func (h *Host) K8sAggregationClient() *aggregationclient.Clientset

K8sAggregationClient returns the host cluster framework's Kubernetes aggregation client.

func (*Host) K8sClient

func (h *Host) K8sClient() kubernetes.Interface

K8sClient returns the host cluster framework's Kubernetes client.

func (*Host) RestConfig

func (h *Host) RestConfig() *rest.Config

RestConfig returns the host cluster framework's rest config.

func (*Host) TargetNamespace

func (h *Host) TargetNamespace() string

type HostConfig

type HostConfig struct {
	Backoff backoff.Interface
	Logger  micrologger.Logger

	ClusterID       string
	TargetNamespace string
}

type PatchSpec

type PatchSpec struct {
	Op    string      `json:"op"`
	Path  string      `json:"path"`
	Value interface{} `json:"value"`
}

PatchSpec is a generic patch type to update objects with JSONPatchType operations.

type VBVParams

type VBVParams struct {
	// Component is the name of an authority inside a versionbundle IndexRelease.
	// e.g. aws-operator
	Component string
	// Provider is the provider of a versionbundle IndexRelease.
	// This can be aws, azure or kvm.
	Provider string
	// Token is a Github token which is authorized to read from the installations
	// repository.
	Token string
	// VType is the version type of a versionbundle IndexRelease which can be
	// either wip or active.
	VType string
}

VBVParams holds information which we can use to query versionbundle version information from the installations repository.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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