Documentation
¶
Index ¶
- Variables
- func Add(ctx context.Context, ref moRef, id string) (err error)
- func DefaultWatchedPropertyPaths() []string
- func JoinContext(left, right context.Context) context.Context
- func NewContext() context.Context
- func Remove(ctx context.Context, ref moRef, id string) (err error)
- func ValidateContext(ctx context.Context) bool
- func WithContext(parent context.Context) context.Context
- type LookupNamespacedNameResult
- type Result
- type Watcher
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAsyncSignalDisabled is returned from the Add/Remove functions if they // are called while async signal is disabled. ErrAsyncSignalDisabled = errors.New("async signal disabled") // ErrNoWatcher is returned from the Add/Remove functions if they are called // without a watcher in the context. ErrNoWatcher = errors.New("no watcher") )
Functions ¶
func Add ¶
Add starts watching a container to which VirtualMachine resources may belong, such as a Folder, Cluster, ResourcePool, etc.
func DefaultWatchedPropertyPaths ¶
func DefaultWatchedPropertyPaths() []string
DefaultWatchedPropertyPaths returns the default set of property paths to watch.
func JoinContext ¶
JoinContext returns a new context that contains a reference to the functions object from the specified context. This function panics if the provided context does not contain a functions object. This function is thread-safe.
func NewContext ¶
NewContext returns a new context with a new functions object.
func Remove ¶
Remove stops watching a container to which VirtualMachine resources may belong, such as a Folder, Cluster, ResourcePool, etc.
func ValidateContext ¶
ValidateContext returns true if the provided context contains the functions object.
Types ¶
type LookupNamespacedNameResult ¶
type LookupNamespacedNameResult struct {
Namespace string
Name string
// Verified indicates whether or not the VM's Kubernetes resource has the
// vSphere VM's managed object ID in status.uniqueID.
Verified bool
// Deleted indicates whether the VM's Kubernetes resource has a
// non-zero deletion timestamp.
Deleted bool
}
LookupNamespacedNameResult is returned from a call to lookup the namespaced name of a vSphere VM.
type Result ¶
type Result struct {
// Namespace is the namespace to which the VirtualMachine resource belongs.
Namespace string
// Name is the name of the VirtualMachine resource.
Name string
// Ref is the ManagedObjectReference for the VM in vSphere.
Ref moRef
// Verified is true if the VirtualMachine resource identified by Namespace
// and Name has already been verified to exist in this Kubernetes cluster.
Verified bool
}
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
func Start ¶
func Start( ctx context.Context, client *vim25.Client, watchedPropertyPaths []string, additionalIgnoredExtraConfigKeys []string, lookupNamespacedName lookupNamespacedNameFn, containerRefsWithIDs map[moRef][]string) (*Watcher, error)
Start begins watching a vSphere server for updates to VM Service managed VMs. If watchedPropertyPaths is nil, DefaultWatchedPropertyPaths will be used. The containerRefsWithIDs parameter may be used to start the watcher with an initial list of entities to watch.
func (*Watcher) Done ¶
func (w *Watcher) Done() <-chan struct{}
Done returns a channel that is closed when the watcher is shutdown.