core

package
v0.1.39 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 72 Imported by: 0

Documentation

Overview

source: https://github.com/openshift/oc/blob/bc2163c506ff27cda7ab907a715aeb1815389ead/pkg/cli/rsync/forwarder.go

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 CreateArchive added in v0.1.10

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

func CreateCluster

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

func DestroyCluster

func DestroyCluster(ctx context.Context, hostedCluster *hyperv1.HostedCluster, o *DestroyOptions, destroyPlatformSpecifics DestroyPlatformSpecifics) 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 GetIngressServicePublishingStrategyMapping added in v0.1.38

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

func GetServicePublishingStrategyMappingByAPIServerAddress added in v0.1.38

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

func NewDumpCommand

func NewDumpCommand() *cobra.Command

Types

type AWSPlatformDestroyOptions

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

type AzurePlatformDestroyOptions

type AzurePlatformDestroyOptions struct {
	CredentialsFile   string
	Location          string
	ResourceGroupName string
}

type CreateOptions

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

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
	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
	ArchiveDump bool
	// 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
	ImpersonateAs    string

	Log logr.Logger
}

type LogChecker

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

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 OCAdmNodeLogs added in v0.1.10

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

func (*OCAdmNodeLogs) Run added in v0.1.10

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

type Platform added in v0.1.38

type Platform interface {
	// ApplyPlatformSpecifics decorates the HostedCluster prototype created from common options with platform-
	// specific values and cAonfigurations.
	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.
	Complete(context.Context, *CreateOptions) (Platform, error)
}

PlatformCompleter knows how to absorb configuration.

type PlatformValidator added in v0.1.38

type PlatformValidator interface {
	// Validate allows the platform-specific logic to validate inputs.
	Validate(context.Context, *CreateOptions) (PlatformCompleter, error)
}

PlatformValidator knows how to validate platform options.

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
	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
	NodeVolumeDetachTimeout          time.Duration
	PullSecretFile                   string
	ReleaseImage                     string
	ReleaseStream                    string
	Render                           bool
	RenderInto                       string
	SSHKeyFile                       string
	ServiceCIDR                      []string
	ClusterCIDR                      []string
	DefaultDual                      bool
	ExternalDNSDomain                string
	Arch                             string
	NodeSelector                     map[string]string
	Wait                             bool
	Timeout                          time.Duration
	Log                              logr.Logger
	SkipAPIBudgetVerification        bool
	NodeUpgradeType                  hyperv1.UpgradeType
	PausedUntil                      string
	OLMCatalogPlacement              hyperv1.OLMCatalogPlacement
	OLMDisableDefaultSources         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

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