cluster

package
v5.0.0-...-b546af2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInsufficientPermissions

func IsInsufficientPermissions(err error) bool

IsInsufficientPermissions asserts insufficientPermissionsError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsInvalidProvider

func IsInvalidProvider(err error) bool

IsInvalidProvider asserts invalidProviderError.

func IsNoResources

func IsNoResources(err error) bool

IsNoResources asserts noResourcesError.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

Types

type Cluster

type Cluster struct {
	Cluster *capi.Cluster

	// helm-based clusters
	ClusterApp     *application.App
	DefaultAppsApp *application.App

	// infrastructure provider cluster
	AWSCluster   *infrastructure.AWSCluster
	AzureCluster *capz.AzureCluster
}

Cluster contains the resources needed to represent a cluster on any supported provider.

func (*Cluster) ClientObject

func (n *Cluster) ClientObject() client.Object

func (*Cluster) Object

func (n *Cluster) Object() runtime.Object

type Collection

type Collection struct {
	Items []Cluster
}

Collection wraps a list of clusters.

func (*Collection) Object

func (cc *Collection) Object() runtime.Object

type Config

type Config struct {
	Client client.Client
}

type GetOptions

type GetOptions struct {
	Name           string
	Provider       string
	Namespace      string
	FallbackToCapi bool
}

type Interface

type Interface interface {
	Get(context.Context, GetOptions) (Resource, error)
	Patch(context.Context, client.Object, PatchOptions) error
}

Interface represents the contract for the clusters service. Using this instead of a regular 'struct' makes mocking the service in tests much simpler.

type PatchOptions

type PatchOptions struct {
	PatchSpecs []PatchSpec
}

type PatchSpec

type PatchSpec struct {
	Op    string      `json:"op"`
	Path  string      `json:"path"`
	Value interface{} `json:"value"`
}

type Resource

type Resource interface {
	Object() runtime.Object
}

type Service

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

func New

func New(config Config) *Service

func (*Service) Get

func (s *Service) Get(ctx context.Context, options GetOptions) (Resource, error)

func (*Service) Patch

func (s *Service) Patch(ctx context.Context, object client.Object, options PatchOptions) error

Jump to

Keyboard shortcuts

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