workflow

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

Documentation

Index

Constants

View Source
const (
	CreateClusterWorkflowName = "pke-vsphere-create-cluster"
)
View Source
const CreateNodeActivityName = "pke-vsphere-create-node"

CreateNodeActivityName is the default registration name of the activity

View Source
const DeleteClusterFromStoreActivityName = "pke-vsphere-delete-cluster-from-store"
View Source
const DeleteClusterWorkflowName = "pke-vsphere-delete-cluster"
View Source
const DeleteK8sNodeActivityName = "delete-k8s-node"
View Source
const DeleteNodeActivityName = "pke-vsphere-delete-node"

DeleteNodeActivityName is the default registration name of the activity

View Source
const DeleteNodePoolFromStoreActivityName = "pke-vsphere-delete-node-pool-from-store"
View Source
const DeleteNodePoolWorkflowName = "pke-vsphere-delete-nodepool"
View Source
const GetPublicAddressActivityName = "pke-vsphere-get-public-address"

GetPublicAddressActivityName is the default registration name of the activity

View Source
const SetClusterStatusActivityName = "pke-vsphere-set-cluster-status"
View Source
const UpdateClusterWorkflowName = "pke-vsphere-update-cluster"
View Source
const WaitForIPActivityName = "pke-vsphere-wait-for-ip"

WaitForIPActivityName is the default registration name of the activity

Variables

This section is empty.

Functions

func DeleteClusterWorkflow

func DeleteClusterWorkflow(ctx workflow.Context, input DeleteClusterWorkflowInput) error

func DeleteNodePoolWorkflow

func DeleteNodePoolWorkflow(ctx workflow.Context, input DeleteNodePoolWorkflowInput) error

func UpdateClusterWorkflow

func UpdateClusterWorkflow(ctx workflow.Context, input UpdateClusterWorkflowInput) error

Types

type CreateClusterWorkflow

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

func NewCreateClusterWorkflow

func NewCreateClusterWorkflow() CreateClusterWorkflow

func (CreateClusterWorkflow) Execute

type CreateClusterWorkflowInput

type CreateClusterWorkflowInput struct {
	ClusterID        uint
	ClusterName      string
	ClusterUID       string
	OrganizationID   uint
	OrganizationName string
	ResourcePoolName string
	FolderName       string
	DatastoreName    string
	SecretID         string
	StorageSecretID  string
	OIDCEnabled      bool
	PostHooks        pkgCluster.PostHooks
	Nodes            []Node
	HTTPProxy        intPKE.HTTPProxy
	NodePoolLabels   map[string]map[string]string
}

CreateClusterWorkflowInput

type CreateNodeActivity

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

CreateNodeActivity represents an activity for creating a vSphere virtual machine

func MakeCreateNodeActivity

func MakeCreateNodeActivity(vmomiClientFactory *VMOMIClientFactory, tokenGenerator pkeworkflowadapter.TokenGenerator, secretStore pkeworkflow.SecretStore) CreateNodeActivity

MakeCreateNodeActivity returns a new CreateNodeActivity

func (CreateNodeActivity) Execute

Execute performs the activity

type CreateNodeActivityInput

type CreateNodeActivityInput struct {
	OrganizationID   uint
	ClusterID        uint
	SecretID         string
	StorageSecretID  string
	ClusterName      string
	ResourcePoolName string
	FolderName       string
	DatastoreName    string
	Node
}

CreateNodeActivityInput represents the input needed for executing a CreateNodeActivity

type DeleteClusterFromStoreActivity

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

func MakeDeleteClusterFromStoreActivity

func MakeDeleteClusterFromStoreActivity(store pke.ClusterStore) DeleteClusterFromStoreActivity

func (DeleteClusterFromStoreActivity) Execute

type DeleteClusterFromStoreActivityInput

type DeleteClusterFromStoreActivityInput struct {
	ClusterID uint
}

type DeleteClusterWorkflowInput

type DeleteClusterWorkflowInput struct {
	ClusterID        uint
	ClusterName      string
	ClusterUID       string
	K8sSecretID      string
	OrganizationID   uint
	OrganizationName string
	ResourcePoolName string
	FolderName       string
	DatastoreName    string
	SecretID         string
	MasterNodes      []Node
	Nodes            []Node
	Forced           bool
}

DeleteClusterWorkflowInput

type DeleteK8sNodeActivity

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

func MakeDeleteK8sNodeActivity

func MakeDeleteK8sNodeActivity(k8sConfigGetter K8sConfigGetter) DeleteK8sNodeActivity

func (DeleteK8sNodeActivity) Execute

type DeleteK8sNodeActivityInput

type DeleteK8sNodeActivityInput struct {
	OrganizationID uint
	ClusterName    string
	K8sSecretID    string
	Name           string
}

type DeleteNodeActivity

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

DeleteNodeActivity represents an activity for creating a vSphere virtual machine

func MakeDeleteNodeActivity

func MakeDeleteNodeActivity(vmomiClientFactory *VMOMIClientFactory) DeleteNodeActivity

MakeDeleteNodeActivity returns a new DeleteNodeActivity

func (DeleteNodeActivity) Execute

func (a DeleteNodeActivity) Execute(ctx context.Context, input DeleteNodeActivityInput) (existed bool, err error)

Execute performs the activity In case of success, it returns whether the given node existed or not.

type DeleteNodeActivityInput

type DeleteNodeActivityInput struct {
	OrganizationID uint
	ClusterID      uint
	SecretID       string
	ClusterName    string
	Node
}

DeleteNodeActivityInput represents the input needed for executing a DeleteNodeActivity

type DeleteNodePoolFromStoreActivity

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

func MakeDeleteNodePoolFromStoreActivity

func MakeDeleteNodePoolFromStoreActivity(store pke.ClusterStore) DeleteNodePoolFromStoreActivity

func (DeleteNodePoolFromStoreActivity) Execute

type DeleteNodePoolFromStoreActivityInput

type DeleteNodePoolFromStoreActivityInput struct {
	ClusterID    uint
	NodePoolName string
}

type DeleteNodePoolWorkflowInput

type DeleteNodePoolWorkflowInput struct {
	ClusterID      uint
	ClusterName    string
	OrganizationID uint
	SecretID       string
	K8sSecretID    string
	NodePool       NodePool
}

DeleteNodePoolWorkflowInput

type GetPublicAddressActivity

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

GetPublicAddressActivity represents an activity to retrieve cluster public address

func MakeGetPublicAddressActivity

func MakeGetPublicAddressActivity(vmomiClientFactory *VMOMIClientFactory) GetPublicAddressActivity

MakeGetPublicAddressActivity returns a new GetPublicAddressActivity

func (GetPublicAddressActivity) Execute

func (a GetPublicAddressActivity) Execute(ctx context.Context, input GetPublicAddressActivityInput) (ipAddress string, err error)

Execute performs the activity In case of success, it returns whether the given node existed or not.

type GetPublicAddressActivityInput

type GetPublicAddressActivityInput struct {
	OrganizationID uint
	SecretID       string
	NodeName       string
}

GetPublicAddressActivityInput represents the input needed for executing a GetPublicAddressActivity

type K8sConfigGetter

type K8sConfigGetter interface {
	Get(organizationID uint, k8sSecretID string) ([]byte, error)
}

type Node

type Node struct {
	AdminUsername          string
	VCPU                   int
	RAM                    int // MiB
	Name                   string
	SSHPublicKey           string
	UserDataScriptParams   map[string]string
	UserDataScriptTemplate string
	TemplateName           string
	NodePoolName           string
	Master                 bool
}

Node represents a vSphere virtual machine

type NodePool

type NodePool struct {
	Name string
	Size int
}

type SetClusterStatusActivity

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

func MakeSetClusterStatusActivity

func MakeSetClusterStatusActivity(store pke.ClusterStore) SetClusterStatusActivity

func (SetClusterStatusActivity) Execute

type SetClusterStatusActivityInput

type SetClusterStatusActivityInput struct {
	ClusterID     uint
	Status        string
	StatusMessage string
}

type UpdateClusterWorkflowInput

type UpdateClusterWorkflowInput struct {
	ClusterID         uint
	ClusterName       string
	ClusterUID        string
	OrganizationID    uint
	OrganizationName  string
	ResourcePoolName  string
	FolderName        string
	DatastoreName     string
	SecretID          string
	StorageSecretID   string
	K8sSecretID       string
	OIDCEnabled       bool
	MasterNodeNames   []string
	NodesToCreate     []Node
	NodesToDelete     []Node
	NodePoolsToDelete []NodePool
	HTTPProxy         intPKE.HTTPProxy
	NodePoolLabels    map[string]map[string]string
}

UpdateClusterWorkflowInput

type VMOMIClientFactory

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

func NewVMOMIClientFactory

func NewVMOMIClientFactory(secretStore pkeworkflow.SecretStore) *VMOMIClientFactory

func (*VMOMIClientFactory) New

func (f *VMOMIClientFactory) New(organizationID uint, secretID string) (*govmomi.Client, error)

type WaitForIPActivity

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

WaitForIPActivity represents an activity for creating a vSphere virtual machine

func MakeWaitForIPActivity

func MakeWaitForIPActivity(vmomiClientFactory *VMOMIClientFactory) WaitForIPActivity

MakeWaitForIPActivity returns a new WaitForIPActivity

func (WaitForIPActivity) Execute

Execute performs the activity

type WaitForIPActivityInput

type WaitForIPActivityInput struct {
	Ref            types.ManagedObjectReference
	OrganizationID uint
	SecretID       string
	ClusterName    string
}

WaitForIPActivityInput represents the input needed for executing a WaitForIPActivity

Jump to

Keyboard shortcuts

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