capsule

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BasicGroupID           = "basic"
	DeploymentGroupID      = "deployment"
	TroubleshootingGroupID = "troubleshooting"
)

Variables

View Source
var CapsuleID string

Functions

func AbortAndDeploy added in v1.2.6

func AbortAndDeploy(
	ctx context.Context,
	rig rig.Client,
	req *connect.Request[capsule.DeployRequest],
) (*connect.Response[capsule.DeployResponse], error)

func Deploy added in v1.4.0

func Deploy(input DeployInput) (*capsule.Revision, error)

func DeployAndWait added in v1.10.5

func DeployAndWait(input DeployAndWaitInput) error

func DeployDry added in v1.11.0

func DeployDry(input DeployDryInput) error

func GetCapsuleInstance added in v1.10.3

func GetCapsuleInstance(
	ctx context.Context,
	rig rig.Client,
	rCtx TargetContext,
	capsuleID string,
) (string, error)

func GetCurrentContainerResources added in v1.2.0

func GetCurrentContainerResources(
	ctx context.Context,
	client rig.Client,
	scope scope.Scope,
) (*capsule.ContainerSettings, uint32, error)

func GetCurrentNetwork added in v1.2.0

func GetCurrentNetwork(ctx context.Context, client rig.Client, scope scope.Scope) (*capsule.Network, error)

func GetCurrentRollout added in v1.2.0

func GetCurrentRollout(ctx context.Context, client rig.Client, scope scope.Scope) (*capsule.Rollout, error)

func GetCurrentRolloutOfCapsule added in v1.6.0

func GetCurrentRolloutOfCapsule(
	ctx context.Context,
	client rig.Client,
	scope scope.Scope,
	capsuleID string,
) (*capsule.Rollout, error)

func PortForward added in v1.10.3

func PortForward(
	ctx context.Context,
	rig rig.Client,
	rCtx *cmdconfig.Context,
	capsuleID, instanceID string,
	localPort uint32,
	remotePort uint32,
	verbose bool,
) error

func PortForwardOnListener added in v1.10.3

func PortForwardOnListener(
	ctx context.Context,
	rig rig.Client,
	rCtx *cmdconfig.Context,
	capsuleID, instanceID string,
	l net.Listener,
	remotePort uint32,
	verbose bool,
) error

func PrintLogs added in v1.3.2

func PromptAbortAndDeploy added in v1.3.0

func PromptAbortAndDeploy(
	ctx context.Context,
	rig rig.Client,
	prompter common.Prompter,
	req *connect.Request[capsule.DeployRequest],
) (*connect.Response[capsule.DeployResponse], error)

func Rollback added in v1.10.3

func Rollback(input RollbackInput) (*capsule.Revision, error)

func SelectCapsule added in v1.7.2

func SelectCapsule(ctx context.Context, rc rig.Client, prompter common.Prompter, scope scope.Scope) (string, error)

func Truncated added in v1.2.0

func Truncated(str string, max int) string

func TruncatedFixed added in v1.2.0

func TruncatedFixed(str string, max int) string

func WaitForRollout added in v1.10.3

func WaitForRollout(input WaitForRolloutInput) error

func WaitForRolloutIteration added in v1.11.0

func WaitForRolloutIteration(input WaitForRolloutInput, state *WaitForRolloutState) (bool, error)

Types

type BaseInput added in v1.11.0

type BaseInput struct {
	// TODO Remove ctx and add as separate argument to functions
	Ctx           context.Context
	Rig           rig.Client
	ProjectID     string
	EnvironmentID string
	CapsuleID     string
}

deployment structs

type DeployAndWaitInput added in v1.11.0

type DeployAndWaitInput struct {
	DeployInput
	Timeout    time.Duration
	RollbackID uint64
	NoWait     bool
}

type DeployDryInput added in v1.11.0

type DeployDryInput struct {
	BaseInput
	Changes            []*capsule.Change
	CurrentRolloutID   uint64
	CurrentFingerprint *model.Fingerprint
	Scheme             *runtime.Scheme
	IsInteractive      bool
}

type DeployInput added in v1.11.0

type DeployInput struct {
	BaseInput
	Changes            []*capsule.Change
	ForceDeploy        bool
	ForceOverride      bool
	CurrentRolloutID   uint64
	CurrentFingerprint *model.Fingerprint
}

type DryOutput added in v1.11.0

type DryOutput struct {
	PlatformCapsule   *platformv1.Capsule `json:"platformCapsule"`
	DirectKubernetes  []any               `json:"directKubernetes"`
	DerivedKubernetes []any               `json:"derivedKubernetes"`
}

type GetRolloutInput added in v1.11.0

type GetRolloutInput struct {
	BaseInput
	RolloutID uint64
}

type RollbackInput added in v1.11.0

type RollbackInput struct {
	BaseInput
	CurrentRolloutID uint64
	RollbackID       uint64
}

type TargetContext added in v1.11.0

type TargetContext interface {
	GetProject() string
	GetEnvironment() string
}

type WaitForRolloutInput added in v1.11.0

type WaitForRolloutInput struct {
	RollbackInput
	Fingerprints *model.Fingerprints
	Timeout      time.Duration
	PrintPrefix  string
}

type WaitForRolloutState added in v1.11.0

type WaitForRolloutState struct {
	HasPolledForRollout bool
	CurrentRolloutID    uint64
	Deadline            time.Time
	LastConfigure       []*api_rollout.StepInfo
	LastResource        []*api_rollout.StepInfo
	LastRunning         []*api_rollout.StepInfo
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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