clusteradapter

package
v0.0.0-...-e7c744b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsClusterNotFoundError

func IsClusterNotFoundError(err error) bool

IsClusterNotFoundError returns true if the passed in error designates a cluster not found error

func NewCloudinfoNodePoolLabelSource

func NewCloudinfoNodePoolLabelSource(client *cloudinfo.Client) cluster.NodePoolLabelSource

NewCloudinfoNodePoolLabelSource returns a new cluster.NodePoolLabelSource that gets default node pool labels from Cloudinfo.

func NewEKSService

func NewEKSService(service eks.Service) cluster.Service

NewEKSService returns a new EKS distribution service.

func NewNodePoolStore

func NewNodePoolStore(db *gorm.DB, clusters cluster.Store) cluster.NodePoolStore

NewNodePoolStore returns a new cluster.NodePoolStore that persists node pools into the database using Gorm.

func NewPKEService

func NewPKEService(service pke.Service) cluster.Service

NewPKEService returns a new PKE distribution service.

Types

type CadenceClusterManager

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

func NewCadenceClusterManager

func NewCadenceClusterManager(workflowClient client.Client) CadenceClusterManager

func (CadenceClusterManager) DeleteCluster

func (m CadenceClusterManager) DeleteCluster(ctx context.Context, clusterID uint, options cluster.DeleteClusterOptions) error

type ClusterDeleterEntry

type ClusterDeleterEntry struct {
	Key     ClusterDeleterKey
	Deleter cluster.Deleter
}

ClusterDeleterEntry is a ClusterDeleterKey - Deleter pair.

type ClusterDeleterKey

type ClusterDeleterKey struct {
	Provider     string
	Distribution string
}

ClusterDeleterKey is used to select the cluster specific deleter implementation.

func MakeClusterDeleterKey

func MakeClusterDeleterKey(provider, distribution string) ClusterDeleterKey

MakeClusterDeleterKey is a helper function that returns a ClusterDeleterKey.

func (ClusterDeleterKey) String

func (k ClusterDeleterKey) String() string

String returns a string representation of the ClusterDeleterKey. This string can be used as a key in a map.

type Clusters

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

Clusters acts as a repository interface for clusters.

func NewClusters

func NewClusters(db *gorm.DB) *Clusters

NewClusters returns a new Clusters instance.

func (*Clusters) All

func (c *Clusters) All() ([]*model.ClusterModel, error)

All returns all cluster instances for an organization.

func (*Clusters) Exists

func (c *Clusters) Exists(organizationID uint, name string) (bool, error)

Exists checks if a given cluster exists within an organization.

func (*Clusters) FindByOrganization

func (c *Clusters) FindByOrganization(organizationID uint) ([]*model.ClusterModel, error)

FindByOrganization returns all cluster instances for an organization.

func (*Clusters) FindBySecret

func (c *Clusters) FindBySecret(organizationID uint, secretID string) ([]*model.ClusterModel, error)

FindBySecret returns all cluster instances for an organization filtered by secret.

func (*Clusters) FindNextWithGreaterID

func (c *Clusters) FindNextWithGreaterID(clusterID uint) (uint, uint, error)

FindNextWithGreaterID returns the next cluster <orgID, clusterID> tuple that is greater than the passed in clusterID

func (*Clusters) FindOneByID

func (c *Clusters) FindOneByID(organizationID uint, clusterID uint) (*model.ClusterModel, error)

FindOneByID returns a cluster instance for an organization by cluster ID.

func (*Clusters) FindOneByName

func (c *Clusters) FindOneByName(organizationID uint, clusterName string) (*model.ClusterModel, error)

FindOneByName returns a cluster instance for an organization by cluster name.

func (*Clusters) GetConfigSecretIDByClusterID

func (c *Clusters) GetConfigSecretIDByClusterID(organizationID uint, clusterID uint) (string, error)

GetConfigSecretIDByClusterID returns the kubeconfig's secretID stored in DB

type PolyClusterDeleter

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

PolyClusterDeleter combines many cluster specific deleters into one.

func NewPolyClusterDeleter

func NewPolyClusterDeleter(clusters cluster.Store, deleters ...ClusterDeleterEntry) PolyClusterDeleter

NewPolyClusterDeleter returns a new PolyClusterDeleter instance.

func (PolyClusterDeleter) DeleteCluster

func (cd PolyClusterDeleter) DeleteCluster(ctx context.Context, clusterID uint, options cluster.DeleteClusterOptions) error

DeleteCluster selects the matching deleter for the cluster and delegates deletion to it.

type Store

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

Store is a Cluster persistence implementation.

func NewStore

func NewStore(db *gorm.DB, clusters *Clusters) Store

NewStore returns a new Store.

func (Store) Exists

func (s Store) Exists(ctx context.Context, id uint) (bool, error)

Exists returns true if the cluster exists in the store and is not deleted

func (Store) GetCluster

func (s Store) GetCluster(ctx context.Context, id uint) (cluster.Cluster, error)

GetCluster returns a generic Cluster. Returns a NotFoundError when the cluster cannot be found.

func (Store) GetClusterByName

func (s Store) GetClusterByName(ctx context.Context, orgID uint, clusterName string) (cluster.Cluster, error)

func (Store) SetStatus

func (s Store) SetStatus(ctx context.Context, id uint, status string, message string) error

SetStatus sets the cluster status.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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