command

package
v0.0.0-...-b394286 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const Gardener_Namespace_Prefix = "garden-kyma"
View Source
const ICON_EMOJI = ":high_brightness:"
View Source
const KCP_Prefix = "kcp"
View Source
const PROD_Postfix = "-prod"
View Source
const SLACK_COLOR = "#36a64f" //green
View Source
const SLACK_USER_NAME = "upgrade-info"

Variables

View Source
var (
	ErrMothershipResponse = errors.New("reconciler error response")
)
View Source
var GlobalOpts = GlobalOptionsKey{
	// contains filtered or unexported fields
}

GlobalOpts is the convenience object for storing the fixed global conifguration (parameter) keys

View Source
var Version string = "N/A"

Version is the CLI version to be filled in by the build system

Functions

func CLICredentialManager

func CLICredentialManager(logger logger.Logger) credential.Manager

CLICredentialManager returns a credential.Manager configured using the CLI global options

func New

func New() *cobra.Command

New constructs a new root command for the kcp CLI.

func NewCompletionCommand

func NewCompletionCommand() *cobra.Command

NewCompletionCmd constructs a new instance of CompletionCommand and configures it in terms of a cobra.Command

func NewDeprovisionCmd

func NewDeprovisionCmd() *cobra.Command

func NewKubeconfigCmd

func NewKubeconfigCmd() *cobra.Command

NewKubeconfigCmd constructs a new instance of KubeconfigCommand and configures it in terms of a cobra.Command

func NewLoginCmd

func NewLoginCmd() *cobra.Command

NewLoginCmd constructs a new instance of LoginCommand and configures it in terms of a cobra.Command

func NewOperationCmd

func NewOperationCmd() *cobra.Command

func NewOperationDebugLogsCmd

func NewOperationDebugLogsCmd() *cobra.Command

func NewOperationStopCmd

func NewOperationStopCmd() *cobra.Command

func NewOrchestrationCmd

func NewOrchestrationCmd() *cobra.Command

NewOrchestrationCmd constructs a new instance of OrchestrationCommand and configures it in terms of a cobra.Command

func NewReconciliationCmd

func NewReconciliationCmd() *cobra.Command

NewUpgradeCmd constructs the reconciliation command and all subcommands under the reconciliation command

func NewReconciliationDebugLogsCmd

func NewReconciliationDebugLogsCmd() *cobra.Command

func NewReconciliationDisableCmd

func NewReconciliationDisableCmd() *cobra.Command

func NewReconciliationEnableCmd

func NewReconciliationEnableCmd() *cobra.Command

func NewReconciliationOperationInfoCmd

func NewReconciliationOperationInfoCmd() *cobra.Command

NewUpgradeCmd constructs the reconciliation command and all subcommands under the reconciliation command

func NewReconciliationPurgeCmd

func NewReconciliationPurgeCmd() *cobra.Command

func NewReconciliationStateCommand

func NewReconciliationStateCommand() *cobra.Command

func NewRuntimeCmd

func NewRuntimeCmd() *cobra.Command

NewRuntimeCmd constructs a new instance of RuntimeCommand and configures it in terms of a cobra.Command

func NewTaskRunCmd

func NewTaskRunCmd() *cobra.Command

NewTaskRunCmd constructs a new instance of TaskRunCommand and configures it in terms of a cobra.Command

func NewUpgradeClusterCommand

func NewUpgradeClusterCommand() *cobra.Command

func NewUpgradeCmd

func NewUpgradeCmd() *cobra.Command

NewUpgradeCmd constructs the upgrade command and all subcommands under the upgrade command

func NewUpgradeKymaCmd

func NewUpgradeKymaCmd() *cobra.Command

NewUpgradeKymaCmd constructs a new instance of UpgradeKymaCommand and configures it in terms of a cobra.Command

func PromptUser

func PromptUser(msg string) bool

func SendSlackNotification

func SendSlackNotification(title string, cobraCmd *cobra.Command, output string, mgr credential.Manager) error

SendSlackNotification will post message including attachments to slackhookUrl.

func SetGlobalOpts

func SetGlobalOpts(cmd *cobra.Command)

SetGlobalOpts configures the global parameters on the given root command

func SetOutputOpt

func SetOutputOpt(cmd *cobra.Command, opt *string)

SetOutputOpt configures the optput type option on the given command

func SetRuntimeTargetOpts

func SetRuntimeTargetOpts(cmd *cobra.Command, targetInputs *[]string, targetExcludeInputs *[]string)

SetRuntimeTargetOpts configures runtime target options on the given command

func ValidateGlobalOpts

func ValidateGlobalOpts() error

ValidateGlobalOpts checks the presence of the required global configuration parameters

func ValidateOutputOpt

func ValidateOutputOpt(opt string) error

ValidateOutputOpt checks whether the given optput type is one of the valid values

func ValidateTransformRuntimeTargetOpts

func ValidateTransformRuntimeTargetOpts(targetInputs []string, targetExcludeInputs []string, targetSpec *orchestration.TargetSpec) error

ValidateTransformRuntimeTargetOpts checks the validity of runtime target options, and transforms them for internal usage

func ValidateUpgradeKymaVersionFmt

func ValidateUpgradeKymaVersionFmt(version string) error

Types

type Attachment

type Attachment struct {
	Text  string `json:"text"`
	Color string `json:"color"`
	Title string `json:"title"`
}

type CompletionCommand

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

CompletionCommand represents an execution of the kcp completion command

func (*CompletionCommand) Run

func (cmd *CompletionCommand) Run(comd *cobra.Command, args []string) error

Run executes the completion command

func (*CompletionCommand) Validate

func (cmd *CompletionCommand) Validate(args []string) error

Validate checks the input parameters of the completion command

type DeprovisionCommand

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

func (*DeprovisionCommand) Run

func (cmd *DeprovisionCommand) Run() error

func (*DeprovisionCommand) Validate

func (cmd *DeprovisionCommand) Validate() error

type Display

type Display struct {
	SubscriptionGlobalAccountID bool
}

type GlobalOptionsKey

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

GlobalOptionsKey is the type for holding the configuration key for each global parameter

func (*GlobalOptionsKey) GardenerKubeconfig

func (keys *GlobalOptionsKey) GardenerKubeconfig() string

GardenerKubeconfig gets the gardener-kubeconfig global parameter

func (*GlobalOptionsKey) GardenerNamespace

func (keys *GlobalOptionsKey) GardenerNamespace() string

GardenerNamespace gets the gardener-namespace global parameter

func (*GlobalOptionsKey) KEBAPIURL

func (keys *GlobalOptionsKey) KEBAPIURL() string

KEBAPIURL gets the keb-api-url global parameter

func (*GlobalOptionsKey) KubeconfigAPIURL

func (keys *GlobalOptionsKey) KubeconfigAPIURL() string

KubeconfigAPIURL gets the kubeconfig-api-url global parameter

func (*GlobalOptionsKey) MothershipAPIURL

func (keys *GlobalOptionsKey) MothershipAPIURL() string

MothershipAPIURL gets the mothership-api-url global parameter

func (*GlobalOptionsKey) OAUTH2ClientID

func (keys *GlobalOptionsKey) OAUTH2ClientID() string

OAUTH2ClientID gets the oauth2-client-id global parameter

func (*GlobalOptionsKey) OAUTH2ClientSecret

func (keys *GlobalOptionsKey) OAUTH2ClientSecret() string

OAUTH2ClientSecret gets the oauth2-client-secret global parameter

func (*GlobalOptionsKey) OAUTH2IssuerURL

func (keys *GlobalOptionsKey) OAUTH2IssuerURL() string

OAUTH2IssuerURL gets the oauth2-issuer-url global parameter

func (*GlobalOptionsKey) OIDCClientID

func (keys *GlobalOptionsKey) OIDCClientID() string

OIDCClientID gets the oidc-client-id global parameter

func (*GlobalOptionsKey) OIDCClientSecret

func (keys *GlobalOptionsKey) OIDCClientSecret() string

OIDCClientSecret gets the oidc-client-secret global parameter

func (*GlobalOptionsKey) OIDCIssuerURL

func (keys *GlobalOptionsKey) OIDCIssuerURL() string

OIDCIssuerURL gets the oidc-issuer-url global parameter

func (*GlobalOptionsKey) SlackAPIURL

func (keys *GlobalOptionsKey) SlackAPIURL() string

SlackAPIURL gets the slack-api-url global parameter

func (*GlobalOptionsKey) Username

func (keys *GlobalOptionsKey) Username() string

Username gets the username to use for auth

type KubeconfigCommand

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

KubeconfigCommand represents an execution of the kcp kubeconfig command

func (*KubeconfigCommand) Run

func (cmd *KubeconfigCommand) Run() error

Run executes the kubeconfig command

func (*KubeconfigCommand) Validate

func (cmd *KubeconfigCommand) Validate() error

Validate checks the input parameters of the kubeconfig command

type LoginCommand

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

LoginCommand represents an execution of the kcp login command

func (*LoginCommand) Run

func (cmd *LoginCommand) Run() error

Run executes the login command

func (*LoginCommand) Validate

func (cmd *LoginCommand) Validate() error

Validate checks the input parameters of the login command

type OrchestrationCommand

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

OrchestrationCommand represents an execution of the kcp orchestrations command

func (*OrchestrationCommand) Run

func (cmd *OrchestrationCommand) Run(args []string) error

Run executes the orchestrations command

func (*OrchestrationCommand) Validate

func (cmd *OrchestrationCommand) Validate(args []string) error

Validate checks the input parameters of the orchestrations command

type ReconcilerInfoResponses

type ReconcilerInfoResponses struct {
	mothership.ReconciliationInfoOKResponse
	KymaConfig mothership.KymaConfig `json:"kymaConfig"`
}

type ReconciliationCommand

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

func (*ReconciliationCommand) Run

func (cmd *ReconciliationCommand) Run() error

func (*ReconciliationCommand) Validate

func (cmd *ReconciliationCommand) Validate() error

type ReconciliationOperationInfoCommand

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

func (*ReconciliationOperationInfoCommand) Run

func (*ReconciliationOperationInfoCommand) Validate

func (cmd *ReconciliationOperationInfoCommand) Validate() error

type RuntimeCommand

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

RuntimeCommand represents an execution of the kcp runtimes command

func (*RuntimeCommand) Run

func (cmd *RuntimeCommand) Run() error

Run executes the runtimes command

func (*RuntimeCommand) Validate

func (cmd *RuntimeCommand) Validate() error

Validate checks the input parameters of the runtimes command

type RuntimeLister

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

RuntimeLister implements the interface to obtains runtimes info from KEB for resolver

func NewRuntimeLister

func NewRuntimeLister(client runtime.Client) *RuntimeLister

NewRuntimeLister constructs a RuntimeLister with the given runtime.Client

func (RuntimeLister) ListAllRuntimes

func (rl RuntimeLister) ListAllRuntimes() ([]runtime.RuntimeDTO, error)

ListAllRuntimes fetches all runtimes from KEB using the runtime client

type RuntimeStateCommand

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

func (*RuntimeStateCommand) Run

func (cmd *RuntimeStateCommand) Run() error

type RuntimeStateOptions

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

func (*RuntimeStateOptions) Validate

func (opts *RuntimeStateOptions) Validate() error

type RuntimeTask

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

RuntimeTask is the runtime operation executed by RuntimeTaskMakager via strategy.

type RuntimeTaskMakager

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

RuntimeTaskMakager implements Executor interface needed by strategy to execute the runtime task operations.

func NewRuntimeTaskMakager

func NewRuntimeTaskMakager(cmd *TaskRunCommand, operations []orchestration.RuntimeOperation) *RuntimeTaskMakager

NewRuntimeTaskMakager constructs a new RuntimeTaskMakager for the given runtime operations

func (*RuntimeTaskMakager) Execute

func (mgr *RuntimeTaskMakager) Execute(operationID string) (time.Duration, error)

Execute runs the task on the runtime identified by the operationID

func (*RuntimeTaskMakager) Reschedule

func (mgr *RuntimeTaskMakager) Reschedule(operationID string, maintenanceWindowBegin, maintenanceWindowEnd time.Time) error

type SlackRequestBody

type SlackRequestBody struct {
	Text        string       `json:"text"`
	Icon_emoji  string       `json:"icon_emoji"`
	Attachments []Attachment `json:"attachments"`
	Username    string       `json:"username"`
}

type TaskRunCommand

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

TaskRunCommand represents an execution of the kcp taskrun command

func (*TaskRunCommand) Run

func (cmd *TaskRunCommand) Run(args []string) error

Run executes the taskrun command

func (*TaskRunCommand) Validate

func (cmd *TaskRunCommand) Validate(args []string) error

Validate checks the input parameters of the taskrun command

type TaskRunError

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

TaskRunError represents failure in task execution for one or more runtimes

func (*TaskRunError) Error

func (e *TaskRunError) Error() string

type UpgradeClusterCommand

type UpgradeClusterCommand struct {
	UpgradeCommand
	// contains filtered or unexported fields
}

func (*UpgradeClusterCommand) Run

func (cmd *UpgradeClusterCommand) Run() error

Run executes the upgrade cluster command

func (*UpgradeClusterCommand) Validate

func (cmd *UpgradeClusterCommand) Validate() error

type UpgradeCommand

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

UpgradeCommand is the base type of all subcommands under the upgrade command. The type holds common attributes and methods inherited by all subcommands

func (*UpgradeCommand) SetUpgradeOpts

func (cmd *UpgradeCommand) SetUpgradeOpts(cobraCmd *cobra.Command)

SetUpgradeOpts configures the upgrade specific options on the given command

func (*UpgradeCommand) ValidateTransformUpgradeOpts

func (cmd *UpgradeCommand) ValidateTransformUpgradeOpts() error

ValidateTransformUpgradeOpts checks in the input upgrade options, and transforms them for internal usage

type UpgradeKymaCommand

type UpgradeKymaCommand struct {
	UpgradeCommand
	// contains filtered or unexported fields
}

UpgradeKymaCommand represents an execution of the kcp upgrade kyma command. Inherits fields and methods of UpgradeCommand

func (*UpgradeKymaCommand) Run

func (cmd *UpgradeKymaCommand) Run() error

Run executes the upgrade kyma command

func (*UpgradeKymaCommand) SetUpgradeOpts

func (cmd *UpgradeKymaCommand) SetUpgradeOpts(cobraCmd *cobra.Command)

SetUpgradeOpts configures the upgrade kyma specific options on the given command

func (*UpgradeKymaCommand) Validate

func (cmd *UpgradeKymaCommand) Validate() error

Validate checks the input parameters of the upgrade kyma command

Directories

Path Synopsis
Package automock is a generated GoMock package.
Package automock is a generated GoMock package.

Jump to

Keyboard shortcuts

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