cli

package
v0.0.0-...-2c539bb Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 104 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DescAnnotation records the description of addon
	DescAnnotation = "addons.oam.dev/description"

	// DependsOnWorkFlowStepName is workflow step name which is used to check dependsOn app
	DependsOnWorkFlowStepName = "depends-on-app"

	// AddonTerraformProviderNamespace is the namespace of addon terraform provider
	AddonTerraformProviderNamespace = "default"
	// AddonTerraformProviderNameArgument is the argument name of addon terraform provider
	AddonTerraformProviderNameArgument = "providerName"
)
View Source
const (
	// FlagClusterName specifies the cluster name
	FlagClusterName = "name"
	// FlagClusterManagementEngine specifies the cluster management type, eg: ocm
	FlagClusterManagementEngine = "engine"
	// FlagKubeConfigPath specifies the kubeconfig path
	FlagKubeConfigPath = "kubeconfig-path"
	// FlagInClusterBootstrap prescribes the cluster registration to use the internal
	// IP from the kube-public/cluster-info configmap, otherwise the endpoint in the
	// hub kubeconfig will be used for registration.
	FlagInClusterBootstrap = "in-cluster-boostrap"

	// CreateNamespace specifies the namespace need to create in managedCluster
	CreateNamespace = "create-namespace"
)
View Source
const (
	App       = "app"
	Service   = "svc"
	Namespace = "namespace"
	Local     = "local"

	// FlagDescription command flag to specify the description of the definition
	FlagDescription = "desc"
	// FlagDryRun command flag to disable actual changes and only display intend changes
	FlagDryRun = "dry-run"
	// FlagTemplateYAML command flag to specify which existing template YAML file to use
	FlagTemplateYAML = "template-yaml"
	// FlagOutput command flag to specify which file to save
	FlagOutput = "output"
	// FlagMessage command flag to specify which file to save
	FlagMessage = "message"
	// FlagType command flag to specify which definition type to use
	FlagType = "type"
	// FlagProvider command flag to specify which provider the cloud resource definition belongs to. Only `alibaba`, `aws`, `azure` are supported.
	FlagProvider = "provider"
	// FlagGit command flag to specify which git repository the configuration(HCL) is stored in
	FlagGit = "git"
	// FlagLocal command flag to specify the local path of Terraform module or resource HCL file
	FlagLocal = "local"
	// FlagPath command flag to specify which path the configuration(HCL) is stored in the Git repository
	FlagPath = "path"
	// FlagNamespace command flag to specify which namespace to use
	FlagNamespace = "namespace"
	// FlagInteractive command flag to specify the use of interactive process
	FlagInteractive = "interactive"
)

constants used in `svc` command

View Source
const (
	// HelmChartNamespacePlaceholder is used as a placeholder for rendering definitions into helm chart format
	HelmChartNamespacePlaceholder = "###HELM_NAMESPACE###"
	// HelmChartFormatEnvName is the name of the environment variable to enable render helm chart format YAML
	HelmChartFormatEnvName = "AS_HELM_CHART"
)
View Source
const (
	// SideBar file name for docsify
	SideBar = "_sidebar.md"
	// NavBar file name for docsify
	NavBar = "_navbar.md"
	// IndexHTML file name for docsify
	IndexHTML = "index.html"
	// CSS file name for custom CSS
	CSS = "custom.css"
	// README file name for docsify
	README = "README.md"
)
View Source
const (
	// HealthStatusHealthy represents healthy status.
	HealthStatusHealthy = v1alpha2.StatusHealthy
	// HealthStatusUnhealthy represents unhealthy status.
	HealthStatusUnhealthy = v1alpha2.StatusUnhealthy
	// HealthStatusUnknown represents unknown status.
	HealthStatusUnknown = v1alpha2.StatusUnknown
)
View Source
const DefaultRegistry = "default"

DefaultRegistry is default registry

View Source
const (
	// ErrNotLoadAppConfig display the error message load
	ErrNotLoadAppConfig = "cannot load the application"
)

Error msg used in `status` command

View Source
const (
	// Port is the port for reference docs website
	Port = ":18081"
)
View Source
const TypeGithub = "github"

TypeGithub represents github

View Source
const TypeLocal = "local"

TypeLocal represents github

View Source
const TypeOss = "oss"

TypeOss represent oss

View Source
const TypeUnknown = "unknown"

TypeUnknown represents parse failed

Variables

View Source
var AllNamespace bool

AllNamespace list app in all namespaces

Functions

func AdditionalEndpointPrinter

func AdditionalEndpointPrinter(ctx context.Context, c common.Args, k8sClient client.Client, name string)

AdditionalEndpointPrinter will print endpoints

func ClusterCommandGroup

func ClusterCommandGroup(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command

ClusterCommandGroup create a group of cluster command

func CreateEnv

func CreateEnv(envArgs *types.EnvMeta, args []string, ioStreams cmdutil.IOStreams) error

CreateEnv creates an environment

func DefinitionCommandGroup

func DefinitionCommandGroup(c common.Args, order string) *cobra.Command

DefinitionCommandGroup create the command group for `vela def` command to manage definitions

func DeleteEnv

func DeleteEnv(args []string, ioStreams cmdutil.IOStreams) error

DeleteEnv deletes an environment

func DryRunApplication

func DryRunApplication(cmdOption *DryRunCmdOptions, c common.Args, namespace string) (bytes.Buffer, error)

DryRunApplication will dry-run an application and return the render result

func GetCapabilityByName

func GetCapabilityByName(name string, workloads []types.Capability) (types.Capability, error)

GetCapabilityByName get eponymous types.Capability from workloads by name

func GetFlagEnvOrCurrent

func GetFlagEnvOrCurrent(cmd *cobra.Command, args common.Args) (*types.EnvMeta, error)

GetFlagEnvOrCurrent gets environment by name or current environment if no env exists, return default namespace as env

func GetFlagNamespaceOrEnv

func GetFlagNamespaceOrEnv(cmd *cobra.Command, args common.Args) (string, error)

GetFlagNamespaceOrEnv will get env and namespace flag, namespace flag takes the priority

func GetOAMReleaseVersion

func GetOAMReleaseVersion(ns string) (string, error)

GetOAMReleaseVersion gets version of vela-core runtime helm release

func GetServiceEndpoints

func GetServiceEndpoints(ctx context.Context, client client.Client, appName string, namespace string, velaC common.Args) ([]querytypes.ServiceEndpoint, error)

GetServiceEndpoints get service endpoints by velaQL

func InstallCompByNameFromRegistry

func InstallCompByNameFromRegistry(args common2.Args, ioStream cmdutil.IOStreams, compName string, registry Registry) error

InstallCompByNameFromRegistry will install given componentName comp to cluster from registry

func InstallTraitByNameFromRegistry

func InstallTraitByNameFromRegistry(args common2.Args, ioStream cmdutil.IOStreams, traitName string, registry Registry) error

InstallTraitByNameFromRegistry will install given traitName trait to cluster

func ListEnvs

func ListEnvs(args []string, ioStreams cmdutil.IOStreams) error

ListEnvs shows info of all environments

func ListRegistryConfig

func ListRegistryConfig() ([]apis.RegistryConfig, error)

ListRegistryConfig will get all registry config stored in local this will return at least one config, which is DefaultRegistry

func LiveDiffApplication

func LiveDiffApplication(cmdOption *LiveDiffCmdOptions, c common.Args, namespace string) (bytes.Buffer, error)

LiveDiffApplication can return user what would change if upgrade an application.

func NewAddAddonRegistryCommand

func NewAddAddonRegistryCommand(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewAddAddonRegistryCommand return an addon registry create command

func NewAddonCommand

func NewAddonCommand(c common.Args, order string, ioStreams cmdutil.IOStreams) *cobra.Command

NewAddonCommand create `addon` command

func NewAddonDisableCommand

func NewAddonDisableCommand(c common.Args, ioStream cmdutil.IOStreams) *cobra.Command

NewAddonDisableCommand create addon disable command

func NewAddonEnableCommand

func NewAddonEnableCommand(c common.Args, ioStream cmdutil.IOStreams) *cobra.Command

NewAddonEnableCommand create addon enable command

func NewAddonListCommand

func NewAddonListCommand(c common.Args) *cobra.Command

NewAddonListCommand create addon list command

func NewAddonRegistryCommand

func NewAddonRegistryCommand(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewAddonRegistryCommand return an addon registry command

func NewAddonStatusCommand

func NewAddonStatusCommand(c common.Args, ioStream cmdutil.IOStreams) *cobra.Command

NewAddonStatusCommand create addon status command

func NewAddonUpgradeCommand

func NewAddonUpgradeCommand(c common.Args, ioStream cmdutil.IOStreams) *cobra.Command

NewAddonUpgradeCommand create addon upgrade command

func NewAppStatusCommand

func NewAppStatusCommand(c common.Args, order string, ioStreams cmdutil.IOStreams) *cobra.Command

NewAppStatusCommand creates `status` command for showing status

func NewCUEPackageCommand

func NewCUEPackageCommand(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewCUEPackageCommand creates `cue-package` command

func NewCapabilityShowCommand

func NewCapabilityShowCommand(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewCapabilityShowCommand shows the reference doc for a component type or trait

func NewClusterDetachCommand

func NewClusterDetachCommand(c *common.Args) *cobra.Command

NewClusterDetachCommand create command to help user detach existing cluster

func NewClusterJoinCommand

func NewClusterJoinCommand(c *common.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewClusterJoinCommand create command to help user join cluster to multicluster management

func NewClusterListCommand

func NewClusterListCommand(c *common.Args) *cobra.Command

NewClusterListCommand create cluster list command

func NewClusterProbeCommand

func NewClusterProbeCommand(c *common.Args) *cobra.Command

NewClusterProbeCommand create command to help user try health probe for existing cluster TODO(somefive): move prob logic into cluster management

func NewClusterRenameCommand

func NewClusterRenameCommand(c *common.Args) *cobra.Command

NewClusterRenameCommand create command to help user rename cluster

func NewCommand

func NewCommand() *cobra.Command

NewCommand will contain all commands

func NewCompGetCommand

func NewCompGetCommand(c common2.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewCompGetCommand creates `comp get` command

func NewCompletionCommand

func NewCompletionCommand() *cobra.Command

NewCompletionCommand Output shell completion code for the specified shell (bash or zsh)

func NewComponentsCommand

func NewComponentsCommand(c common2.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewComponentsCommand creates `components` command

func NewDefinitionApplyCommand

func NewDefinitionApplyCommand(c common.Args) *cobra.Command

NewDefinitionApplyCommand create the `vela def apply` command to help user apply local definitions to k8s

func NewDefinitionDelCommand

func NewDefinitionDelCommand(c common.Args) *cobra.Command

NewDefinitionDelCommand create the `vela def del` command to help user delete existing definitions conveniently

func NewDefinitionEditCommand

func NewDefinitionEditCommand(c common.Args) *cobra.Command

NewDefinitionEditCommand create the `vela def edit` command to help user edit remote definitions

func NewDefinitionGenDocCommand

func NewDefinitionGenDocCommand(c common.Args) *cobra.Command

NewDefinitionGenDocCommand create the `vela def doc-gen` command to generate documentation of definitions

func NewDefinitionGetCommand

func NewDefinitionGetCommand(c common.Args) *cobra.Command

NewDefinitionGetCommand create the `vela def get` command to get definition from k8s

func NewDefinitionInitCommand

func NewDefinitionInitCommand(c common.Args) *cobra.Command

NewDefinitionInitCommand create the `vela def init` command to help user initialize a definition locally

func NewDefinitionListCommand

func NewDefinitionListCommand(c common.Args) *cobra.Command

NewDefinitionListCommand create the `vela def list` command to list definition from k8s

func NewDefinitionRenderCommand

func NewDefinitionRenderCommand(c common.Args) *cobra.Command

NewDefinitionRenderCommand create the `vela def render` command to help user render definition cue file into k8s YAML file, if used without kubernetes environment, set IGNORE_KUBE_CONFIG=true

func NewDefinitionValidateCommand

func NewDefinitionValidateCommand(c common.Args) *cobra.Command

NewDefinitionValidateCommand create the `vela def vet` command to help user validate the definition

func NewDeleteAddonRegistryCommand

func NewDeleteAddonRegistryCommand(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewDeleteAddonRegistryCommand return an addon registry delete command

func NewDeleteCommand

func NewDeleteCommand(c common2.Args, order string, ioStreams cmdutil.IOStreams) *cobra.Command

NewDeleteCommand Delete App

func NewDryRunCommand

func NewDryRunCommand(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewDryRunCommand creates `dry-run` command

func NewEnvCommand

func NewEnvCommand(c common.Args, order string, ioStream cmdutil.IOStreams) *cobra.Command

NewEnvCommand creates `env` command and its nested children

func NewEnvDeleteCommand

func NewEnvDeleteCommand(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewEnvDeleteCommand creates `env delete` command for deleting environments

func NewEnvInitCommand

func NewEnvInitCommand(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewEnvInitCommand creates `env init` command for initializing environments

func NewEnvListCommand

func NewEnvListCommand(c common.Args, ioStream cmdutil.IOStreams) *cobra.Command

NewEnvListCommand creates `env list` command for listing all environments

func NewEnvSetCommand

func NewEnvSetCommand(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewEnvSetCommand creates `env set` command for setting current environment

func NewExecCommand

func NewExecCommand(c common.Args, order string, ioStreams util.IOStreams) *cobra.Command

NewExecCommand creates `exec` command

func NewExportCommand

func NewExportCommand(c common2.Args, ioStream cmdutil.IOStreams) *cobra.Command

NewExportCommand will create command for exporting deploy manifests from an AppFile

func NewGetAddonRegistryCommand

func NewGetAddonRegistryCommand(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewGetAddonRegistryCommand return an addon registry get command

func NewHelpCommand

func NewHelpCommand() *cobra.Command

NewHelpCommand get any command help

func NewInitCommand

func NewInitCommand(c common2.Args, order string, ioStreams cmdutil.IOStreams) *cobra.Command

NewInitCommand creates `init` command

func NewInstallCommand

func NewInstallCommand(c common.Args, order string, ioStreams util.IOStreams) *cobra.Command

NewInstallCommand creates `install` command to install vela core

func NewListAddonRegistryCommand

func NewListAddonRegistryCommand(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewListAddonRegistryCommand return an addon registry list command

func NewListCommand

func NewListCommand(c common.Args, order string, ioStreams cmdutil.IOStreams) *cobra.Command

NewListCommand creates `ls` command and its nested children command

func NewLiveDiffCommand

func NewLiveDiffCommand(c common.Args, order string, ioStreams cmdutil.IOStreams) *cobra.Command

NewLiveDiffCommand creates `live-diff` command

func NewLogsCommand

func NewLogsCommand(c common.Args, order string, ioStreams util.IOStreams) *cobra.Command

NewLogsCommand creates `logs` command to tail logs of application

func NewPortForwardCommand

func NewPortForwardCommand(c common.Args, order string, ioStreams util.IOStreams) *cobra.Command

NewPortForwardCommand is vela port-forward command

func NewRegistryCommand

func NewRegistryCommand(ioStream cmdutil.IOStreams, order string) *cobra.Command

NewRegistryCommand Manage Capability Center

func NewRegistryConfigCommand

func NewRegistryConfigCommand(ioStreams cmdutil.IOStreams) *cobra.Command

NewRegistryConfigCommand Configure (add if not exist) a registry, default is local (built-in capabilities)

func NewRegistryListCommand

func NewRegistryListCommand(ioStreams cmdutil.IOStreams) *cobra.Command

NewRegistryListCommand List all registry

func NewRegistryRemoveCommand

func NewRegistryRemoveCommand(ioStreams cmdutil.IOStreams) *cobra.Command

NewRegistryRemoveCommand Remove specified registry

func NewTemplateCommand

func NewTemplateCommand(ioStream cmdutil.IOStreams) *cobra.Command

NewTemplateCommand creates `template` command and its nested children command

func NewTemplateContextCommand

func NewTemplateContextCommand(ioStream cmdutil.IOStreams) *cobra.Command

NewTemplateContextCommand creates `context` command

func NewTraitCommand

func NewTraitCommand(c common2.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewTraitCommand creates `traits` command

func NewTraitGetCommand

func NewTraitGetCommand(c common2.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewTraitGetCommand creates `trait get` command

func NewUISchemaCommand

func NewUISchemaCommand(c common.Args, order string, ioStreams util.IOStreams) *cobra.Command

NewUISchemaCommand creates `uischema` command

func NewUnInstallCommand

func NewUnInstallCommand(c common.Args, order string, ioStreams util.IOStreams) *cobra.Command

NewUnInstallCommand creates `uninstall` command to uninstall vela core

func NewUpCommand

func NewUpCommand(c common2.Args, order string, ioStream cmdutil.IOStreams) *cobra.Command

NewUpCommand will create command for applying an AppFile

func NewUpdateAddonRegistryCommand

func NewUpdateAddonRegistryCommand(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewUpdateAddonRegistryCommand return an addon registry update command

func NewVersionCommand

func NewVersionCommand(ioStream util.IOStreams) *cobra.Command

NewVersionCommand print client version

func NewVersionListCommand

func NewVersionListCommand(ioStream util.IOStreams) *cobra.Command

NewVersionListCommand show all versions command

func NewWorkflowCommand

func NewWorkflowCommand(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewWorkflowCommand create `workflow` command

func NewWorkflowRestartCommand

func NewWorkflowRestartCommand(c common.Args, ioStream cmdutil.IOStreams) *cobra.Command

NewWorkflowRestartCommand create workflow restart command

func NewWorkflowResumeCommand

func NewWorkflowResumeCommand(c common.Args, ioStream cmdutil.IOStreams) *cobra.Command

NewWorkflowResumeCommand create workflow resume command

func NewWorkflowRollbackCommand

func NewWorkflowRollbackCommand(c common.Args, ioStream cmdutil.IOStreams) *cobra.Command

NewWorkflowRollbackCommand create workflow rollback command

func NewWorkflowSuspendCommand

func NewWorkflowSuspendCommand(c common.Args, ioStream cmdutil.IOStreams) *cobra.Command

NewWorkflowSuspendCommand create workflow suspend command

func NewWorkflowTerminateCommand

func NewWorkflowTerminateCommand(c common.Args, ioStream cmdutil.IOStreams) *cobra.Command

NewWorkflowTerminateCommand create workflow terminate command

func NewWorkloadsCommand

func NewWorkloadsCommand(c common2.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewWorkloadsCommand creates `workloads` command

func OpenBrowser

func OpenBrowser(url string) error

OpenBrowser will open browser by url in different OS system nolint:gosec

func ParseCapability

func ParseCapability(mapper discoverymapper.DiscoveryMapper, data []byte) (types.Capability, error)

ParseCapability will convert config from remote center to capability

func PrintComponentListFromRegistry

func PrintComponentListFromRegistry(registry Registry, ioStreams cmdutil.IOStreams, filter filterFunc) error

PrintComponentListFromRegistry print a table which shows all components from registry

func PrintHelpByTag

func PrintHelpByTag(cmd *cobra.Command, all []*cobra.Command, tag string)

PrintHelpByTag print custom defined help message

func PrintInstalledCompDef

func PrintInstalledCompDef(c common2.Args, io cmdutil.IOStreams, filter filterFunc) error

PrintInstalledCompDef will print all ComponentDefinition in cluster

func PrintInstalledTraitDef

func PrintInstalledTraitDef(c common2.Args, io cmdutil.IOStreams, filter filterFunc) error

PrintInstalledTraitDef will print all TraitDefinition in cluster

func PrintTraitListFromRegistry

func PrintTraitListFromRegistry(registry Registry, ioStreams cmdutil.IOStreams, filter filterFunc) error

PrintTraitListFromRegistry print a table which shows all traits from registry

func ReadObjectsFromFile

func ReadObjectsFromFile(path string) ([]oam.Object, error)

ReadObjectsFromFile will read objects from file or dir in the format of yaml

func RunHelp

func RunHelp(cmd *cobra.Command, args []string)

RunHelp exec help [command]

func SetEnv

func SetEnv(args []string, ioStreams cmdutil.IOStreams) error

SetEnv sets current environment

func ShowReferenceConsole

func ShowReferenceConsole(ctx context.Context, c common.Args, ioStreams cmdutil.IOStreams, capabilityName string, ns string) error

ShowReferenceConsole will show capability reference in console

func StoreRepos

func StoreRepos(registries []apis.RegistryConfig) error

StoreRepos will store registry repo locally

func TransAddonName

func TransAddonName(name string) string

TransAddonName will turn addon's name from xxx/yyy to xxx-yyy

Types

type Args

type Args struct {
	Output    string
	Args      common.Args
	Namespace string
	Container string
	App       *v1beta1.Application
}

Args creates arguments for `logs` command

func (*Args) Run

func (l *Args) Run(ctx context.Context, ioStreams util.IOStreams) error

Run refer to the implementation at https://github.com/oam-dev/stern/blob/master/stern/main.go

type CompStatus

type CompStatus int

CompStatus represents the status of a component during "vela init"

func TrackDeployStatus

func TrackDeployStatus(c common.Args, appName string, namespace string) (CompStatus, string, error)

TrackDeployStatus will only check AppConfig is deployed successfully,

type Content

type Content struct {
	OssContent
	GithubContent
	LocalContent
}

Content contains different type of content needed when building Registry

func Parse

func Parse(addr string) (string, *Content, error)

Parse will parse config from address

type DryRunCmdOptions

type DryRunCmdOptions struct {
	cmdutil.IOStreams
	ApplicationFile string
	DefinitionFile  string
}

DryRunCmdOptions contains dry-run cmd options

type GithubContent

type GithubContent struct {
	URL   string `json:"url"`
	Owner string `json:"owner"`
	Repo  string `json:"repo"`
	Path  string `json:"path"`
	Ref   string `json:"ref"`
}

GithubContent for registry

type GithubRegistry

type GithubRegistry struct {
	URL          string `json:"url"`
	RegistryName string `json:"registry_name"`
	// contains filtered or unexported fields
}

GithubRegistry is Registry's implementation treat github url as resource

func (GithubRegistry) GetCap

func (g GithubRegistry) GetCap(addonName string) (types.Capability, []byte, error)

GetCap return capability object and raw data specified by cap name

func (GithubRegistry) GetName

func (g GithubRegistry) GetName() string

GetName will return registry name

func (GithubRegistry) GetURL

func (g GithubRegistry) GetURL() string

GetURL will return github registry url

func (GithubRegistry) ListCaps

func (g GithubRegistry) ListCaps() ([]types.Capability, error)

ListCaps list all capabilities of registry

type HealthStatus

type HealthStatus = v1alpha2.HealthStatus

HealthStatus represents health status strings.

const (
	// HealthStatusNotDiagnosed means there's no health scope referred or unknown health status returned
	HealthStatusNotDiagnosed HealthStatus = "NOT DIAGNOSED"
)

type InstallArgs

type InstallArgs struct {
	Args          common.Args
	Values        []string
	Namespace     string
	Version       string
	ChartFilePath string
	Detail        bool
	ReuseValues   bool
	// contains filtered or unexported fields
}

InstallArgs the args for install command

type ListBucketResult

type ListBucketResult struct {
	File  []string `xml:"Contents>Key"`
	Count int      `xml:"KeyCount"`
}

ListBucketResult describe a file list from OSS

type LiveDiffCmdOptions

type LiveDiffCmdOptions struct {
	DryRunCmdOptions
	Revision string
	Context  int
}

LiveDiffCmdOptions contains the live-diff cmd options

type LocalContent

type LocalContent struct {
	AbsDir string `json:"abs_dir"`
}

LocalContent for local registry

type LocalRegistry

type LocalRegistry struct {
	AbsPath      string `json:"abs_path"`
	RegistryName string `json:"registry_name"`
}

LocalRegistry is Registry's implementation treat local url as resource

func (LocalRegistry) GetCap

func (l LocalRegistry) GetCap(addonName string) (types.Capability, []byte, error)

GetCap return capability object and raw data specified by cap name

func (LocalRegistry) GetName

func (l LocalRegistry) GetName() string

GetName return name of LocalRegistry

func (LocalRegistry) GetURL

func (l LocalRegistry) GetURL() string

GetURL return path of LocalRegistry

func (LocalRegistry) ListCaps

func (l LocalRegistry) ListCaps() ([]types.Capability, error)

ListCaps list all capabilities of registry

type OssContent

type OssContent struct {
	BucketURL string `json:"bucket_url"`
}

OssContent for oss registry

type OssRegistry

type OssRegistry struct {
	*http.Client `json:"-"`
	BucketURL    string `json:"bucket_url"`
	RegistryName string `json:"registry_name"`
}

OssRegistry is Registry's implementation treat OSS url as resource

func (OssRegistry) GetCap

func (o OssRegistry) GetCap(addonName string) (types.Capability, []byte, error)

GetCap return capability object and raw data specified by cap name

func (OssRegistry) GetName

func (o OssRegistry) GetName() string

GetName return name of OssRegistry

func (OssRegistry) GetURL

func (o OssRegistry) GetURL() string

GetURL return URL of OssRegistry's bucket

func (OssRegistry) ListCaps

func (o OssRegistry) ListCaps() ([]types.Capability, error)

ListCaps list all capabilities of registry

type PrintList

type PrintList []Printable

PrintList is a list of Printable

func (PrintList) Len

func (p PrintList) Len() int

func (PrintList) Less

func (p PrintList) Less(i, j int) bool

func (PrintList) Swap

func (p PrintList) Swap(i, j int)

type Printable

type Printable struct {
	Order string

	Long string
	// contains filtered or unexported fields
}

Printable is a struct for print help

type Registry

type Registry interface {
	GetName() string
	GetURL() string
	GetCap(addonName string) (types.Capability, []byte, error)
	ListCaps() ([]types.Capability, error)
}

Registry define a registry used to get and list types.Capability

func GetRegistry

func GetRegistry(regName string) (Registry, error)

GetRegistry get a Registry implementation by name

func NewRegistry

func NewRegistry(ctx context.Context, token, registryName string, regURL string) (Registry, error)

NewRegistry will create a registry implementation

func NewRegistryFromConfig

func NewRegistryFromConfig(config apis.RegistryConfig) (Registry, error)

NewRegistryFromConfig return Registry interface to get capabilities

type RegistryFile

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

RegistryFile describes a file item in registry

type ScopeHealthCondition

type ScopeHealthCondition = v1alpha2.ScopeHealthCondition

ScopeHealthCondition holds health condition of a scope

type UnInstallArgs

type UnInstallArgs struct {
	Args      common.Args
	Namespace string
	Detail    bool
	// contains filtered or unexported fields
}

UnInstallArgs the args for uninstall command

type UserInput

type UserInput struct {
	Writer io.Writer
	Reader *bufio.Reader
}

UserInput user input in command

func NewUserInput

func NewUserInput() *UserInput

NewUserInput new user input util

func (*UserInput) AskBool

func (ui *UserInput) AskBool(question string, opts *UserInputOptions) bool

AskBool format the answer to bool type

type UserInputOptions

type UserInputOptions struct {
	AssumeYes bool
}

UserInputOptions user input options

type VelaExecOptions

type VelaExecOptions struct {
	Cmd   *cobra.Command
	Args  []string
	Stdin bool
	TTY   bool

	Ctx   context.Context
	VelaC common.Args
	Env   *types.EnvMeta
	App   *v1beta1.Application

	ClientSet kubernetes.Interface
	// contains filtered or unexported fields
}

VelaExecOptions creates options for `exec` command

func (*VelaExecOptions) Complete

func (o *VelaExecOptions) Complete() error

Complete loads data from the command environment

func (*VelaExecOptions) Init

func (o *VelaExecOptions) Init(ctx context.Context, c *cobra.Command, argsIn []string) error

Init prepares the arguments accepted by the Exec command

func (*VelaExecOptions) Run

func (o *VelaExecOptions) Run() error

Run executes a validated remote execution against a pod

type VelaPortForwardOptions

type VelaPortForwardOptions struct {
	Cmd  *cobra.Command
	Args []string

	Ctx   context.Context
	VelaC common.Args
	Env   *types.EnvMeta
	App   *v1beta1.Application

	ClientSet kubernetes.Interface
	Client    client.Client
	// contains filtered or unexported fields
}

VelaPortForwardOptions for vela port-forward

func (*VelaPortForwardOptions) Complete

func (o *VelaPortForwardOptions) Complete() error

Complete will complete the config of port-forward

func (*VelaPortForwardOptions) Init

func (o *VelaPortForwardOptions) Init(ctx context.Context, cmd *cobra.Command, argsIn []string) error

Init will initialize

func (*VelaPortForwardOptions) Run

func (o *VelaPortForwardOptions) Run() error

Run will execute port-forward

type WorkloadHealthCondition

type WorkloadHealthCondition = v1alpha2.WorkloadHealthCondition

WorkloadHealthCondition holds health status of any resource

Jump to

Keyboard shortcuts

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