machinepool

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Defines helper objects used by the machine pool creation command and unit tests.

Package machinepool is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:     "machinepool --cluster={NAME|ID|EXTERNAL_ID} --instance-type=TYPE --replicas=N [flags] MACHINE_POOL_ID",
	Aliases: []string{"machinepools", "machine-pool", "machine-pools"},
	Short:   "Add machine pool to cluster",
	Long:    "Add a machine pool to the cluster.",
	Example: `  # Add a machine pool mp-1 with 3 replicas and m5.xlarge instance type to a cluster
  ocm create machinepool --cluster mycluster --instance-type m5.xlarge --replicas 3 mp-1
  # Add a machine pool mp-1 with autoscaling enabled and 3 to 6 replicas of m5.xlarge to a cluster
  ocm create machinepool --cluster=mycluster --enable-autoscaling \
  --min-replicas=3 --max-replicas=6 --instance-type=m5.xlarge mp-1 
  # Add a machine pool mp-1 with labels and m5.xlarge instance type to a cluster
  ocm create machinepool --cluster mycluster --instance-type m5.xlarge --replicas 3 --labels "foo=bar,bar=baz" mp-1
  # Add a machine pool mp-1 with taints and m5.xlarge instance type to a cluster
  ocm create machinepool --cluster mycluster --instance-type m5.xlarge --replicas 3 --taints "foo=bar:NoSchedule" mp-1`,
	RunE: run,
}

Functions

func VerifyArguments added in v1.0.4

func VerifyArguments(
	args Args,
	flags FlagSet,
	machineTypeListGetter MachineTypeListGetter,
	cluster ocm.Cluster,
) error

func VerifyCluster added in v1.0.4

func VerifyCluster(cluster ocm.Cluster) error

Types

type Args added in v1.0.4

type Args struct {
	Argv                       []string
	ClusterKey                 string
	InstanceType               string
	Replicas                   int
	Autoscaling                c.Autoscaling
	Labels                     string
	Taints                     string
	AdditionalSecurityGroupIds []string
	AvailabilityZone           string
}

type FlagSet added in v1.0.4

type FlagSet interface {
	Changed(flagId string) bool
	CheckOneOf(flagName string, options []arguments.Option) error
}

type MachineTypeListGetter added in v1.0.4

type MachineTypeListGetter interface {
	GetMachineTypeOptions(ocm.Cluster) ([]arguments.Option, error)
}

type MockFlagSet added in v1.0.4

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

MockFlagSet is a mock of FlagSet interface.

func NewMockFlagSet added in v1.0.4

func NewMockFlagSet(ctrl *gomock.Controller) *MockFlagSet

NewMockFlagSet creates a new mock instance.

func (*MockFlagSet) Changed added in v1.0.4

func (m *MockFlagSet) Changed(flagId string) bool

Changed mocks base method.

func (*MockFlagSet) CheckOneOf added in v1.0.4

func (m *MockFlagSet) CheckOneOf(flagName string, options []arguments.Option) error

CheckOneOf mocks base method.

func (*MockFlagSet) EXPECT added in v1.0.4

func (m *MockFlagSet) EXPECT() *MockFlagSetMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

type MockFlagSetMockRecorder added in v1.0.4

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

MockFlagSetMockRecorder is the mock recorder for MockFlagSet.

func (*MockFlagSetMockRecorder) Changed added in v1.0.4

func (mr *MockFlagSetMockRecorder) Changed(flagId any) *gomock.Call

Changed indicates an expected call of Changed.

func (*MockFlagSetMockRecorder) CheckOneOf added in v1.0.4

func (mr *MockFlagSetMockRecorder) CheckOneOf(flagName, options any) *gomock.Call

CheckOneOf indicates an expected call of CheckOneOf.

type MockMachineTypeListGetter added in v1.0.4

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

MockMachineTypeListGetter is a mock of MachineTypeListGetter interface.

func NewMockMachineTypeListGetter added in v1.0.4

func NewMockMachineTypeListGetter(ctrl *gomock.Controller) *MockMachineTypeListGetter

NewMockMachineTypeListGetter creates a new mock instance.

func (*MockMachineTypeListGetter) EXPECT added in v1.0.4

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockMachineTypeListGetter) GetMachineTypeOptions added in v1.0.4

func (m *MockMachineTypeListGetter) GetMachineTypeOptions(arg0 ocm.Cluster) ([]arguments.Option, error)

GetMachineTypeOptions mocks base method.

type MockMachineTypeListGetterMockRecorder added in v1.0.4

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

MockMachineTypeListGetterMockRecorder is the mock recorder for MockMachineTypeListGetter.

func (*MockMachineTypeListGetterMockRecorder) GetMachineTypeOptions added in v1.0.4

func (mr *MockMachineTypeListGetterMockRecorder) GetMachineTypeOptions(arg0 any) *gomock.Call

GetMachineTypeOptions indicates an expected call of GetMachineTypeOptions.

Jump to

Keyboard shortcuts

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