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) FetchCluster ¶
func (*Runtime) GetClusterKey ¶
Load the cluster key provided by the user into the runtime and return it
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