core

package
v0.1.89 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 50 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindDeveloperOptions added in v0.1.38

func BindDeveloperOptions(opts *RawCreateOptions, flags *pflag.FlagSet)

BindDeveloperOptions binds options that should only be exposed to developers in the `hypershift` CLI

func BindOptions added in v0.1.38

func BindOptions(opts *RawCreateOptions, flags *pflag.FlagSet)

BindOptions binds options that should always be exposed to users in all CLIs

func CreateCluster

func CreateCluster(ctx context.Context, rawOpts *RawCreateOptions, rawPlatform PlatformValidator, clientProvider *ClientProvider) error

func DestroyCluster

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

func GetAPIServerAddressByNode

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

func GetIngressServicePublishingStrategyMapping added in v0.1.38

func GetIngressServicePublishingStrategyMapping(netType hyperv1.NetworkType, usesExternalDNS bool, isPrivate bool) []hyperv1.ServicePublishingStrategyMapping

func GetServicePublishingStrategyMappingByAPIServerAddress added in v0.1.38

func GetServicePublishingStrategyMappingByAPIServerAddress(APIServerAddress string, netType hyperv1.NetworkType) []hyperv1.ServicePublishingStrategyMapping

Types

type AWSPlatformDestroyOptions

type AWSPlatformDestroyOptions struct {
	Credentials                  awsutil.AWSCredentialsOptions
	BaseDomain                   string
	BaseDomainPrefix             string
	PreserveIAM                  bool
	Region                       string
	PostDeleteAction             func()
	AwsInfraGracePeriod          time.Duration
	VPCOwnerCredentials          awsutil.AWSCredentialsOptions
	PrivateZonesInClusterAccount bool
}

type AzurePlatformDestroyOptions

type AzurePlatformDestroyOptions struct {
	CredentialsFile              string
	Location                     string
	ResourceGroupName            string
	PreserveResourceGroup        bool
	Cloud                        string
	DNSZoneRGName                string
	NSGResourceGroupName         string
	VnetResourceGroupName        string
	OnRoleAssignmentCleanupError func(error)
}

type ClientProvider added in v0.1.87

type ClientProvider = util.ClientProvider

ClientProvider is an alias for the management-cluster dependencies used by cluster create commands.

func ResolveClientProvider added in v0.1.87

func ResolveClientProvider(clientProviders ...*ClientProvider) *ClientProvider

ResolveClientProvider returns the injected provider or the production provider when no dependency was supplied.

type CreateOptions

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

func (*CreateOptions) Client added in v0.1.87

func (opts *CreateOptions) Client() (crclient.Client, error)

Client returns the injected management-cluster client, creating it lazily when a command phase needs API access.

type DefaultNodePoolConstructor added in v0.1.38

type DefaultNodePoolConstructor func(platformType hyperv1.PlatformType, suffix string) *hyperv1.NodePool

type DestroyOptions

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

type DestroyPlatformSpecifics

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

DestroyPlatformSpecifics can be used to destroy platform specific resources which are unknown to hypershift. The management-cluster client is supplied so platform cleanup can reuse the same client as the HostedCluster lifecycle.

type Platform added in v0.1.38

type Platform interface {
	// ApplyPlatformSpecifics decorates the HostedCluster prototype created from common options with platform-
	// specific values and configurations.
	ApplyPlatformSpecifics(*hyperv1.HostedCluster) error

	// GenerateNodePools generates the NodePools that need to exist for this guest cluster to be functional.
	GenerateNodePools(DefaultNodePoolConstructor) []*hyperv1.NodePool

	// GenerateResources generates the additional resources that need to exist for this guest cluster to be functional.
	GenerateResources() ([]crclient.Object, error)
}

Platform closes over the work that each platform does when creating a HostedCluster and the associated resources. The Platform knows how to decorate the HostedClusterSpec itself as well as how to add new resources to the list that needs to be applied to the cluster for a functional guest cluster.

type PlatformCompleter added in v0.1.38

type PlatformCompleter interface {
	// Complete allows the platform-specific logic to default values from the agnostic set.
	// Returns a Platform implementation on success, or an error if completion fails.
	Complete(context.Context, *CreateOptions) (Platform, error)
}

PlatformCompleter knows how to absorb configuration. All platform implementations MUST use this exact signature for their Complete() method. This unified signature enables interface-based programming and easier maintenance.

type PlatformValidator added in v0.1.38

type PlatformValidator interface {
	// Validate allows the platform-specific logic to validate inputs.
	// Returns a PlatformCompleter on success, or an error if validation fails.
	Validate(context.Context, *CreateOptions) (PlatformCompleter, error)
}

PlatformValidator knows how to validate platform options. All platform implementations MUST use this exact signature for their Validate() method. This unified signature enables interface-based programming and easier maintenance.

type PowerVSPlatformDestroyOptions

type PowerVSPlatformDestroyOptions struct {
	BaseDomain             string
	ResourceGroup          string
	CISCRN                 string
	CISDomainID            string
	Region                 string
	Zone                   string
	VPCRegion              string
	VPC                    string
	CloudInstanceID        string
	CloudConnection        string
	Debug                  bool
	PER                    bool
	TransitGatewayLocation string
	TransitGateway         string
}

type RawCreateOptions added in v0.1.38

type RawCreateOptions struct {
	AdditionalTrustBundle            string
	Annotations                      []string
	Labels                           []string
	AutoRepair                       bool
	ControlPlaneAvailabilityPolicy   string
	ControlPlaneOperatorImage        string
	EtcdStorageClass                 string
	EtcdStorageSize                  string
	EtcdShards                       []string
	FIPS                             bool
	GenerateSSH                      bool
	ImageContentSources              string
	InfrastructureAvailabilityPolicy string
	InfrastructureJSON               string
	InfraID                          string
	Kubeconfig                       string
	Name                             string
	Namespace                        string
	BaseDomain                       string
	BaseDomainPrefix                 string
	NetworkType                      string
	NodePoolReplicas                 int32
	NodeDrainTimeout                 time.Duration
	NodeVolumeDetachTimeout          time.Duration
	PullSecretFile                   string
	ReleaseImage                     string
	ReleaseStream                    string
	Render                           bool
	RenderInto                       string
	RenderSensitive                  bool
	SSHKeyFile                       string
	ServiceCIDR                      []string
	ClusterCIDR                      []string
	MachineCIDR                      []string
	DefaultDual                      bool
	ExternalDNSDomain                string
	Arch                             string
	NodeSelector                     map[string]string
	PodsLabels                       map[string]string
	Tolerations                      []string
	Wait                             bool
	Timeout                          time.Duration
	Log                              logr.Logger
	SkipAPIBudgetVerification        bool
	NodeUpgradeType                  hyperv1.UpgradeType
	PausedUntil                      string
	OLMCatalogPlacement              hyperv1.OLMCatalogPlacement
	OLMDisableDefaultSources         bool
	FeatureSet                       string
	EnableClusterCapabilities        []string
	DisableClusterCapabilities       []string
	KubeAPIServerDNSName             string
	KASServiceAnnotations            []string
	KASLoadBalancerClass             string
	DisableMultiNetwork              bool
	OVNKubernetesMTU                 int32
	VersionCheck                     bool
	RedactBaseDomain                 bool
	AllocateNodeCIDRs                bool

	// 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:"-"`

	// These fields are reverse-completed by the aws CLI since we support a flag that projects
	// them back up here
	PublicKey, PrivateKey, PullSecret []byte
}

func DefaultOptions added in v0.1.38

func DefaultOptions() *RawCreateOptions

func (*RawCreateOptions) Validate added in v0.1.38

func (opts *RawCreateOptions) Validate(ctx context.Context, clientProvider *ClientProvider) (*ValidatedCreateOptions, error)

type ValidatedCreateOptions added in v0.1.38

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

func (*ValidatedCreateOptions) Complete added in v0.1.38

func (opts *ValidatedCreateOptions) Complete() (*CreateOptions, error)

Jump to

Keyboard shortcuts

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