core

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCluster

func CreateCluster(ctx context.Context, opts *CreateOptions, platformSpecificApply ApplyPlatformSpecifics) error

func DestroyCluster

func DestroyCluster(ctx context.Context, hostedCluster *hyperv1.HostedCluster, o *DestroyOptions, destroyPlatformSpecifics DestroyPlatformSpecifics) error

func DestroyPlatformSpecificsNoop

func DestroyPlatformSpecificsNoop(_ context.Context, _ *DestroyOptions) error

func DumpCluster

func DumpCluster(ctx context.Context, opts *DumpOptions) error

func DumpGuestCluster

func DumpGuestCluster(ctx context.Context, log logr.Logger, kubeconfig string, destDir string) error

DumpGuestCluster dumps resources from a hosted cluster using its apiserver indicated by the provided kubeconfig. This function assumes that pods aren't able to be scheduled and so can only gather information directly accessible through the api server.

func GetAPIServerAddressByNode

func GetAPIServerAddressByNode(ctx context.Context, l logr.Logger) (string, error)

func NewDumpCommand

func NewDumpCommand() *cobra.Command

func Validate

func Validate(ctx context.Context, opts *CreateOptions) error

Types

type AWSPlatformDestroyOptions

type AWSPlatformDestroyOptions struct {
	AWSCredentialsFile string
	BaseDomain         string
	BaseDomainPrefix   string
	PreserveIAM        bool
	Region             string
	PostDeleteAction   func()
}

type AWSPlatformOptions

type AWSPlatformOptions struct {
	AWSCredentialsFile      string
	AdditionalTags          []string
	IAMJSON                 string
	InstanceType            string
	IssuerURL               string
	PrivateZoneID           string
	PublicZoneID            string
	Region                  string
	RootVolumeIOPS          int64
	RootVolumeSize          int64
	RootVolumeType          string
	RootVolumeEncryptionKey string
	EndpointAccess          string
	Zones                   []string
	EtcdKMSKeyARN           string
	EnableProxy             bool
}

type AgentPlatformCreateOptions

type AgentPlatformCreateOptions struct {
	APIServerAddress string
	AgentNamespace   string
}

type ApplyPlatformSpecifics

type ApplyPlatformSpecifics = func(ctx context.Context, fixture *apifixtures.ExampleOptions, options *CreateOptions) error

ApplyPlatformSpecifics can be used to create platform specific values as well as enriching the fixure with additional values

type AzurePlatformDestroyOptions

type AzurePlatformDestroyOptions struct {
	CredentialsFile string
	Location        string
}

type AzurePlatformOptions

type AzurePlatformOptions struct {
	CredentialsFile   string
	Location          string
	InstanceType      string
	DiskSizeGB        int32
	AvailabilityZones []string
}

type CreateOptions

type CreateOptions struct {
	AdditionalTrustBundle            string
	Annotations                      []string
	AutoRepair                       bool
	ControlPlaneAvailabilityPolicy   string
	ControlPlaneOperatorImage        string
	EtcdStorageClass                 string
	FIPS                             bool
	GenerateSSH                      bool
	ImageContentSources              string
	InfrastructureAvailabilityPolicy string
	InfrastructureJSON               string
	InfraID                          string
	Name                             string
	Namespace                        string
	BaseDomain                       string
	BaseDomainPrefix                 string
	NetworkType                      string
	NodePoolReplicas                 int32
	NodeDrainTimeout                 time.Duration
	PullSecretFile                   string
	ReleaseImage                     string
	Render                           bool
	SSHKeyFile                       string
	ServiceCIDR                      string
	ClusterCIDR                      string
	ExternalDNSDomain                string
	NodeSelector                     map[string]string
	NonePlatform                     NonePlatformCreateOptions
	KubevirtPlatform                 KubevirtPlatformCreateOptions
	AWSPlatform                      AWSPlatformOptions
	AgentPlatform                    AgentPlatformCreateOptions
	AzurePlatform                    AzurePlatformOptions
	PowerVSPlatform                  PowerVSPlatformOptions
	Wait                             bool
	Timeout                          time.Duration
	Log                              logr.Logger
	SkipAPIBudgetVerification        bool
	CredentialSecretName             string
	NodeUpgradeType                  hyperv1.UpgradeType

	// BeforeApply is called immediately before resources are applied to the
	// server, giving the user an opportunity to inspect or mutate the resources.
	// This is intended primarily for e2e testing and should be used with care.
	BeforeApply func(crclient.Object) `json:"-"`
}

type DestroyOptions

type DestroyOptions struct {
	ClusterGracePeriod    time.Duration
	Name                  string
	Namespace             string
	AWSPlatform           AWSPlatformDestroyOptions
	AzurePlatform         AzurePlatformDestroyOptions
	PowerVSPlatform       PowerVSPlatformDestroyOptions
	InfraID               string
	DestroyCloudResources bool
	Log                   logr.Logger
	CredentialSecretName  string
}

type DestroyPlatformSpecifics

type DestroyPlatformSpecifics = func(ctx context.Context, options *DestroyOptions) error

DestroyPlatformSpecifics can be used to destroy platform specific resources which are unknown to hypershift

type DumpOptions

type DumpOptions struct {
	Namespace   string
	Name        string
	ArtifactDir string
	// LogCheckers is a list of functions that will
	// get run over all raw logs if set.
	LogCheckers []LogChecker
	// AgentNamespace is the namespace where Agents
	// are located, when using the agent platform.
	AgentNamespace string

	DumpGuestCluster bool

	Log logr.Logger
}

type KubevirtPlatformCreateOptions

type KubevirtPlatformCreateOptions struct {
	ServicePublishingStrategy string
	APIServerAddress          string
	Memory                    string
	Cores                     uint32
	ContainerDiskImage        string
	RootVolumeSize            uint32
	RootVolumeStorageClass    string
	RootVolumeAccessModes     string
}

type LogChecker

type LogChecker func(filename string, content []byte)

type NonePlatformCreateOptions

type NonePlatformCreateOptions struct {
	APIServerAddress          string
	ExposeThroughLoadBalancer bool
}

type OCAdmInspect

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

func (*OCAdmInspect) Run

func (i *OCAdmInspect) Run(ctx context.Context, cmdArgs ...string)

func (*OCAdmInspect) WithNamespace

func (i *OCAdmInspect) WithNamespace(namespace string) *OCAdmInspect

type PowerVSPlatformDestroyOptions

type PowerVSPlatformDestroyOptions struct {
	BaseDomain    string
	ResourceGroup string
	CISCRN        string
	CISDomainID   string
	Region        string
	Zone          string
	VPCRegion     string
	Debug         bool
}

type PowerVSPlatformOptions

type PowerVSPlatformOptions struct {
	ResourceGroup   string
	Region          string
	Zone            string
	CloudInstanceID string
	CloudConnection string
	VPCRegion       string
	VPC             string
	VPCSubnet       string
	Debug           bool
	RecreateSecrets bool

	// nodepool related options
	SysType    string
	ProcType   hyperv1.PowerVSNodePoolProcType
	Processors string
	Memory     int32
}

Jump to

Keyboard shortcuts

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