clusters

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

func New

func New(id string) *Cluster

Initializes a new cluster. Panics if id is empty.

func (*Cluster) APIServerEndpoint

func (c *Cluster) APIServerEndpoint() string

APIServerEndpoint returns the cluster's API server endpoint. Returns an empty string if the REST config has not been initialized.

func (*Cluster) Client

func (c *Cluster) Client() client.Client

Client returns the cluster's client.

func (*Cluster) Cluster

func (c *Cluster) Cluster() cluster.Cluster

Cluster returns the cluster's controller-runtime 'Cluster' representation.

func (*Cluster) ConfigPath

func (c *Cluster) ConfigPath() string

ConfigPath returns the cluster's config path.

func (*Cluster) HasClient

func (c *Cluster) HasClient() bool

HasClient returns true if the cluster has a client. If this returns false, create a client via InitializeClient().

func (*Cluster) HasID

func (c *Cluster) HasID() bool

HasID returns true if the cluster has an id. If this returns false, initialize a new cluster via New() or InitializeID().

func (*Cluster) HasRESTConfig

func (c *Cluster) HasRESTConfig() bool

HasRESTConfig returns true if the cluster has a REST config. If this returns false, load the config via InitializeRESTConfig().

func (*Cluster) ID

func (c *Cluster) ID() string

ID returns the cluster's id.

func (*Cluster) InitializeClient

func (c *Cluster) InitializeClient(scheme *runtime.Scheme) error

InitializeClient creates a new client for the cluster. This also initializes the cluster's controller-runtime 'Cluster' representation. If the client has already been initialized, this is a no-op. Panics if the cluster's REST config has not been loaded (InitializeRESTConfig must be called first).

func (*Cluster) InitializeID

func (c *Cluster) InitializeID(id string)

InitializeID sets the cluster's id. Panics if id is empty.

func (*Cluster) InitializeRESTConfig

func (c *Cluster) InitializeRESTConfig() error

InitializeRESTConfig loads the cluster's REST config. If the config has already been loaded, this is a no-op. Panics if the cluster's id is not set (InitializeID must be called first).

func (*Cluster) RESTConfig

func (c *Cluster) RESTConfig() *rest.Config

RESTConfig returns the cluster's REST config. This returns a pointer, but modification can lead to inconsistent behavior and is not recommended.

func (*Cluster) RegisterConfigPathFlag

func (c *Cluster) RegisterConfigPathFlag(flags *flag.FlagSet)

RegisterConfigPathFlag adds a flag '--<id>-cluster' for the cluster's config path to the given flag set. Panics if the cluster's id is not set.

func (*Cluster) Scheme

func (c *Cluster) Scheme() *runtime.Scheme

Scheme returns the cluster's scheme. Returns nil if the client has not been initialized.

func (*Cluster) WithConfigPath

func (c *Cluster) WithConfigPath(cfgPath string) *Cluster

WithConfigPath sets the config path for the cluster. Returns the cluster for chaining.

Jump to

Keyboard shortcuts

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