rosa

package
v1.2.41 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRunner added in v1.2.38

func DefaultRunner(visitor RuntimeVisitor, runner CommandRunner) func(command *cobra.Command, args []string)

DefaultRunner is a centralised implementation of the default Cobra Command.run function that takes care of instantiating several key resources on behalf of a command

Types

type CommandRunner added in v1.2.38

type CommandRunner func(ctx context.Context, runtime *Runtime, command *cobra.Command, args []string) error

CommandRunner is a function supplied by Commands of the ROSA CLI that perform the actual logic of running the command

type Runtime

type Runtime struct {
	Reporter   *reporter.Object
	Logger     *logrus.Logger
	OCMClient  *ocm.Client
	AWSClient  aws.Client
	Creator    *aws.Creator
	ClusterKey string
	Cluster    *cmv1.Cluster
	Spinner    *spinner.Spinner
}

func NewRuntime

func NewRuntime() *Runtime

func (*Runtime) Cleanup

func (r *Runtime) Cleanup()

func (*Runtime) FetchCluster

func (r *Runtime) FetchCluster() *cmv1.Cluster

func (*Runtime) GetClusterKey

func (r *Runtime) GetClusterKey() string

Load the cluster key provided by the user into the runtime and return it

func (*Runtime) WithAWS

func (r *Runtime) WithAWS() *Runtime

Adds an AWS client to the runtime

func (*Runtime) WithOCM

func (r *Runtime) WithOCM() *Runtime

Adds an OCM client to the runtime. Requires a deferred call to `.Cleanup()` to close connections.

type RuntimeVisitor added in v1.2.38

type RuntimeVisitor func(ctx context.Context, runtime *Runtime, command *cobra.Command, args []string)

RuntimeVisitor are functions that configure the Runtime for a command.

func DefaultRuntime added in v1.2.38

func DefaultRuntime() RuntimeVisitor

DefaultRuntime returns a Runtime with the most basic of setups. None of the clients are initialised.

func RuntimeWithAWS added in v1.2.38

func RuntimeWithAWS() RuntimeVisitor

RuntimeWithAWS configures the Runtime with an AWS client

func RuntimeWithOCM added in v1.2.38

func RuntimeWithOCM() RuntimeVisitor

RuntimeWithOCM configures the Runtime with an OCM Client

func RuntimeWithOCMAndAWS added in v1.2.38

func RuntimeWithOCMAndAWS() RuntimeVisitor

RuntimeWithOCMAndAWS configures the Runtime with an OCM Client and AWS client

Jump to

Keyboard shortcuts

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