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: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CIVersion specifies the version tag used for ci builds
	CIVersion = "ci"
)

Variables

This section is empty.

Functions

func CreateClusterJWT

func CreateClusterJWT(id string) (string, error)

CreateClusterJWT generates jwt used in cluster registration

func SendRequestToSubscriber

func SendRequestToSubscriber(subscriberRequest SubscriberRequests, r store.StateData)

SendRequestToSubscriber sends events from the graphQL server to the subscribers listening for the requests

func ValidateClusterJWT

func ValidateClusterJWT(token string) (string, error)

ValidateClusterJWT validates the cluster jwt

Types

type Service

type Service interface {
	RegisterCluster(request model.RegisterClusterRequest) (*model.RegisterClusterResponse, error)
	UpdateCluster(query bson.D, update bson.D) error
	ConfirmClusterRegistration(request model.ClusterIdentity, r store.StateData) (*model.ConfirmClusterRegistrationResponse, error)
	NewClusterEvent(request model.NewClusterEventRequest, r store.StateData) (string, error)
	DeleteClusters(ctx context.Context, projectID string, clusterIds []*string, r store.StateData) (string, error)
	ListClusters(projectID string, clusterType *string) ([]*model.Cluster, error)
	GetAgentDetails(ctx context.Context, clusterID string, projectID string) (*model.Cluster, error)
	GetManifestWithClusterID(clusterID string, accessKey string) ([]byte, error)
	SendClusterEvent(eventType, eventName, description string, cluster model.Cluster, r store.StateData)
	VerifyCluster(identity model.ClusterIdentity) (*dbSchemaCluster.Cluster, error)
	GetManifest(token string) ([]byte, int, error)
	GetCluster(clusterID string) (dbSchemaCluster.Cluster, error)
	GetEndpoint(agentType utils.AgentType) (string, error)
	GetClusterResource(manifest string, namespace string) (*unstructured.Unstructured, error)
}

func NewService

func NewService(clusterOperator *dbSchemaCluster.Operator, chaosWorkflowOperator *dbOperationsWorkflow.Operator, kubeClients *k8s.KubeClients) Service

NewService returns a new instance of Service

type SubscriberRequests

type SubscriberRequests struct {
	RequestType  string  `json:"request_type"`
	K8sManifest  string  `json:"k8s_manifest"`
	ExternalData *string `json:"external_data"`
	ProjectID    string  `json:"project_id"`
	ClusterID    string  `json:"cluster_id"`
	Namespace    string  `json:"namespace"`
	Username     *string `json:"username"`
}

SubscriberRequests contains the required configurable parameters for the requests sent to the subscriber

Directories

Path Synopsis
model
mocks
Package mocks ...
Package mocks ...

Jump to

Keyboard shortcuts

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