core

package
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 70 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 CreateArchive added in v0.1.10

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

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 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()
	AwsInfraGracePeriod time.Duration
}

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
	SingleNATGateway        bool
	MultiArch               bool
}

type AgentPlatformCreateOptions

type AgentPlatformCreateOptions struct {
	APIServerAddress   string
	AgentNamespace     string
	AgentLabelSelector 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 fixture with additional values

type AzurePlatformDestroyOptions

type AzurePlatformDestroyOptions struct {
	CredentialsFile   string
	Location          string
	ResourceGroupName string
}

type AzurePlatformOptions

type AzurePlatformOptions struct {
	CredentialsFile        string
	Location               string
	EncryptionKeyID        string
	InstanceType           string
	DiskSizeGB             int32
	AvailabilityZones      []string
	ResourceGroupName      string
	DiskEncryptionSetID    string
	NetworkSecurityGroup   string
	EnableEphemeralOSDisk  bool
	DiskStorageAccountType string
	ResourceGroupTags      map[string]string
	SubnetName             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
	ReleaseStream                    string
	Render                           bool
	SSHKeyFile                       string
	ServiceCIDR                      []string
	ClusterCIDR                      []string
	DefaultDual                      bool
	ExternalDNSDomain                string
	Arch                             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
	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:"-"`
}

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 KubevirtPlatformCreateOptions

type KubevirtPlatformCreateOptions struct {
	ServicePublishingStrategy        string
	APIServerAddress                 string
	Memory                           string
	Cores                            uint32
	ContainerDiskImage               string
	RootVolumeSize                   uint32
	RootVolumeStorageClass           string
	RootVolumeAccessModes            string
	RootVolumeVolumeMode             string
	InfraKubeConfigFile              string
	InfraNamespace                   string
	CacheStrategyType                string
	InfraStorageClassMappings        []string
	InfraVolumeSnapshotClassMappings []string
	NetworkInterfaceMultiQueue       string
	QoSClass                         string
	AdditionalNetworks               []string
	AttachDefaultNetwork             *bool
	VmNodeSelector                   map[string]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 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 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 PowerVSPlatformOptions

type PowerVSPlatformOptions struct {
	// ResourceGroup to use in IBM Cloud
	ResourceGroup string
	// Region to use in PowerVS service in IBM Cloud
	Region string
	// Zone to use in PowerVS service in IBM Cloud
	Zone string
	// CloudInstanceID of the existing PowerVS service instance
	// Set this field when reusing existing resources from IBM Cloud
	CloudInstanceID string
	// CloudConnection is name of the existing cloud connection
	// Set this field when reusing existing resources from IBM Cloud
	CloudConnection string
	// VPCRegion to use in IBM Cloud
	// Set this field when reusing existing resources from IBM Cloud
	VPCRegion string
	// VPC is name of the existing VPC instance
	VPC string
	// Debug flag is to enable debug logs in powervs client
	Debug bool
	// RecreateSecrets flag is to delete the existing secrets created in IBM Cloud and recreate new secrets
	// This is required since cannot recover the secret once its created
	// Can be used during rerun
	RecreateSecrets bool
	// PER flag is to choose Power Edge Router via Transit Gateway instead of using cloud connections to connect VPC
	PER bool
	// TransitGatewayLocation to use in Transit gateway service in IBM Cloud
	TransitGatewayLocation string
	// TransitGateway is name of the existing Transit gateway instance
	// Set this field when reusing existing resources from IBM Cloud
	TransitGateway string

	// nodepool related options
	// SysType of the worker node in PowerVS service
	SysType string
	// ProcType of the worker node in PowerVS service
	ProcType hyperv1.PowerVSNodePoolProcType
	// Processors count of the worker node in PowerVS service
	Processors string
	// Memory of the worker node in PowerVS service
	Memory int32
}

Jump to

Keyboard shortcuts

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