cluster

package
v0.0.0-...-d4d4b81 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	ClusterID          string        `bson:"cluster_id"`
	ProjectID          string        `bson:"project_id"`
	ClusterName        string        `bson:"cluster_name"`
	Description        *string       `bson:"description"`
	PlatformName       string        `bson:"platform_name"`
	AgentNamespace     *string       `bson:"agent_namespace"`
	Serviceaccount     *string       `bson:"serviceaccount"`
	AgentScope         string        `bson:"agent_scope"`
	AgentNsExists      *bool         `bson:"agent_ns_exists"`
	AgentSaExists      *bool         `bson:"agent_sa_exists"`
	AccessKey          string        `bson:"access_key"`
	IsRegistered       bool          `bson:"is_registered"`
	IsClusterConfirmed bool          `bson:"is_cluster_confirmed"`
	IsActive           bool          `bson:"is_active"`
	UpdatedAt          string        `bson:"updated_at"`
	CreatedAt          string        `bson:"created_at"`
	ClusterType        string        `bson:"cluster_type"`
	Token              string        `bson:"token"`
	IsRemoved          bool          `bson:"is_removed"`
	SkipSSL            *bool         `bson:"skip_ssl"`
	NodeSelector       *string       `bson:"node_selector"`
	Tolerations        []*Toleration `bson:"tolerations,omitempty"`
	StartTime          string        `bson:"start_time"`
	Version            string        `bson:"version"`
}

Cluster contains the required fields to be stored in the database for a cluster

type Operator

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

Operator is the model for cluster collection

func NewClusterOperator

func NewClusterOperator(mongodbOperator mongodb.MongoOperator) *Operator

NewClusterOperator returns a new instance of Operator

func (*Operator) GetAgentDetails

func (c *Operator) GetAgentDetails(ctx context.Context, clusterID string, projectID string) (Cluster, error)

GetAgentDetails takes a agentName and projectID to retrieve the cluster details from the database

func (*Operator) GetAggregateProjects

func (c *Operator) GetAggregateProjects(ctx context.Context, pipeline mongo.Pipeline, opts *options.AggregateOptions) (*mongo.Cursor, error)

GetAggregateProjects takes a mongo pipeline to retrieve the project details from the database

func (*Operator) GetCluster

func (c *Operator) GetCluster(clusterID string) (Cluster, error)

GetCluster takes a clusterID to retrieve the cluster details from the database

func (*Operator) GetClusterWithProjectID

func (c *Operator) GetClusterWithProjectID(projectID string, clusterType *string) ([]*Cluster, error)

GetClusterWithProjectID takes projectID and clusterType parameters to retrieve the cluster details from the database

func (*Operator) InsertCluster

func (c *Operator) InsertCluster(cluster Cluster) error

InsertCluster takes details of a cluster and inserts into the database collection

func (*Operator) ListClusters

func (c *Operator) ListClusters(ctx context.Context, query bson.D) ([]*Cluster, error)

ListClusters returns all the clusters matching the query

func (*Operator) UpdateCluster

func (c *Operator) UpdateCluster(query bson.D, update bson.D) error

UpdateCluster takes query and update parameters to update the cluster details in the database

type Toleration

type Toleration struct {
	Key               *string `bson:"key,omitempty" yaml:"key,omitempty" json:"key,omitempty"`
	Operator          *string `bson:"operator,omitempty" yaml:"operator,omitempty" json:"operator,omitempty"`
	Effect            *string `bson:"effect,omitempty" yaml:"effect,omitempty" json:"effect,omitempty"`
	Value             *string `bson:"value,omitempty" yaml:"value,omitempty" json:"value,omitempty"`
	TolerationSeconds *int    `bson:"toleration_seconds,omitempty" yaml:"tolerationSeconds,omitempty" json:"tolerationSeconds,omitempty"`
}

Jump to

Keyboard shortcuts

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