context

package
v0.5.3-beta.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterContext

type ClusterContext struct {
	context.Context
	Cluster        *clusterv1.Cluster
	VSphereCluster *v1alpha2.VSphereCluster
	Client         client.Client
	Logger         logr.Logger
	// contains filtered or unexported fields
}

ClusterContext is a Go context used with a CAPI cluster.

func NewClusterContext

func NewClusterContext(params *ClusterContextParams) (*ClusterContext, error)

NewClusterContext returns a new ClusterContext.

func NewClusterLoggerContext

func NewClusterLoggerContext(parentContext *ClusterContext, loggerContext string) *ClusterContext

NewClusterLoggerContext creates a new ClusterContext with the given logger context.

func (*ClusterContext) CanLogin

func (c *ClusterContext) CanLogin() bool

CanLogin returns a flag indicating whether the cluster config has enough information to login to the vSphere endpoint.

func (*ClusterContext) ClusterName

func (c *ClusterContext) ClusterName() string

ClusterName returns the name of the cluster.

func (*ClusterContext) GetClient added in v0.5.0

func (c *ClusterContext) GetClient() client.Client

GetClient returns the controller client.

func (*ClusterContext) GetCluster added in v0.4.0

func (c *ClusterContext) GetCluster() *clusterv1.Cluster

GetCluster returns the Cluster object.

func (*ClusterContext) GetLogger

func (c *ClusterContext) GetLogger() logr.Logger

GetLogger returns the Logger.

func (*ClusterContext) GetObject

func (c *ClusterContext) GetObject() runtime.Object

GetObject returns the Cluster object.

func (*ClusterContext) Pass

func (c *ClusterContext) Pass() string

Pass returns the password used to access the vSphere endpoint.

func (*ClusterContext) Patch

func (c *ClusterContext) Patch() error

Patch updates the object and its status on the API server.

func (*ClusterContext) String

func (c *ClusterContext) String() string

Strings returns ClusterNamespace/ClusterName

func (*ClusterContext) User

func (c *ClusterContext) User() string

User returns the username used to access the vSphere endpoint.

type ClusterContextParams

type ClusterContextParams struct {
	Context        context.Context
	Cluster        *clusterv1.Cluster
	VSphereCluster *v1alpha2.VSphereCluster
	Client         client.Client
	Logger         logr.Logger
}

ClusterContextParams are the parameters needed to create a ClusterContext.

type MachineContext

type MachineContext struct {
	*ClusterContext
	Machine        *clusterv1.Machine
	VSphereMachine *v1alpha2.VSphereMachine
	Session        *Session
	// contains filtered or unexported fields
}

MachineContext is a Go context used with a CAPI cluster.

func NewMachineContext

func NewMachineContext(params *MachineContextParams) (*MachineContext, error)

NewMachineContext returns a new MachineContext.

func NewMachineContextFromClusterContext

func NewMachineContextFromClusterContext(
	clusterCtx *ClusterContext,
	machine *clusterv1.Machine,
	vsphereMachine *v1alpha2.VSphereMachine) (*MachineContext, error)

NewMachineContextFromClusterContext creates a new MachineContext using an existing CluserContext.

func NewMachineLoggerContext

func NewMachineLoggerContext(parentContext *MachineContext, loggerContext string) *MachineContext

NewMachineLoggerContext creates a new MachineContext with the given logger context.

func (*MachineContext) GetObject

func (c *MachineContext) GetObject() runtime.Object

GetObject returns the Machine object.

func (*MachineContext) GetSession

func (c *MachineContext) GetSession() *Session

GetSession returns the login session for this context.

func (*MachineContext) Patch

func (c *MachineContext) Patch() error

Patch updates the object and its status on the API server.

func (*MachineContext) String

func (c *MachineContext) String() string

Strings returns ClusterNamespace/ClusterName/MachineName

type MachineContextParams

type MachineContextParams struct {
	ClusterContextParams
	Machine        *clusterv1.Machine
	VSphereMachine *v1alpha2.VSphereMachine
}

MachineContextParams are the parameters needed to create a MachineContext.

type Session

type Session struct {
	*govmomi.Client
	Finder *find.Finder
	// contains filtered or unexported fields
}

Session is a vSphere session with a configured Finder.

func (*Session) FindByInstanceUUID

func (s *Session) FindByInstanceUUID(ctx context.Context, uuid string) (object.Reference, error)

FindByInstanceUUID finds an object by its instance UUID.

func (*Session) FindByUUID

func (s *Session) FindByUUID(ctx context.Context, uuid string) (object.Reference, error)

FindByUUID finds an object by its UUID.

Jump to

Keyboard shortcuts

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