Documentation ¶
Index ¶
- func ApplyApplication(app corev1beta1.Application, ioStream cmdutil.IOStreams, clt client.Client) error
- func BaseComplete(namespace string, c common.Args, workloadName string, appName string, ...) (*api.Application, error)
- func BuildRun(ctx context.Context, app *api.Application, client client.Client, ...) error
- func CheckLabelExistence(labels map[string]string, label string) bool
- func ConvertApplyTo(applyTo []string, workloads []types.Capability) []string
- func HackForStandardTrait(tp types.Capability, client client.Client) error
- func Info(app *corev1beta1.Application) string
- func InitApplication(namespace string, c common.Args, workloadName string, appGroup string) (*api.Application, error)
- func InstallComponentDefinition(client client.Client, componentData []byte, ioStreams cmdutil.IOStreams, ...) error
- func InstallPrometheusInstance(kubecli client.Client) error
- func InstallTraitDefinition(client client.Client, mapper discoverymapper.DiscoveryMapper, traitdata []byte, ...) error
- func IsAppfile(body []byte) bool
- func ListRawWorkloadDefinitions(userNamespace string, c common.Args) ([]v1beta1.WorkloadDefinition, error)
- func LoadAppFile(pathOrURL string) (*api.AppFile, error)
- func Parse(applyTo string) string
- func ReadRemoteOrLocalPath(pathOrURL string) ([]byte, error)
- type AppfileOptions
- func (o *AppfileOptions) ApplyApp(app *corev1beta1.Application, scopes []oam.Object) error
- func (o *AppfileOptions) BaseAppFileRun(result *BuildResult, args common.Args) error
- func (o *AppfileOptions) Export(filePath, namespace string, quiet bool, c common.Args) (*BuildResult, []byte, error)
- func (o *AppfileOptions) ExportFromAppFile(app *api.AppFile, namespace string, quiet bool, c common.Args) (*BuildResult, []byte, error)
- func (o *AppfileOptions) Run(filePath, namespace string, c common.Args) error
- type BuildResult
- type DeleteOptions
- func (o *DeleteOptions) DeleteApp(io cmdutil.IOStreams) error
- func (o *DeleteOptions) DeleteAppWithoutDoubleCheck(io cmdutil.IOStreams) error
- func (o *DeleteOptions) DeleteComponent(io cmdutil.IOStreams) error
- func (o *DeleteOptions) ForceDeleteApp(io cmdutil.IOStreams) error
- func (o *DeleteOptions) WaitUntilDeleteApp(io cmdutil.IOStreams) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyApplication ¶ added in v1.1.0
func ApplyApplication(app corev1beta1.Application, ioStream cmdutil.IOStreams, clt client.Client) error
ApplyApplication will apply an application file in K8s GVK format
func BaseComplete ¶
func BaseComplete(namespace string, c common.Args, workloadName string, appName string, flagSet *pflag.FlagSet, workloadType string) (*api.Application, error)
BaseComplete will construct an Application from cli parameters.
func BuildRun ¶
func BuildRun(ctx context.Context, app *api.Application, client client.Client, namespace string, io util.IOStreams) error
BuildRun will build application and deploy from Appfile
func CheckLabelExistence ¶ added in v1.1.1
CheckLabelExistence checks whether a label `key=value` exists in definition labels
func ConvertApplyTo ¶
func ConvertApplyTo(applyTo []string, workloads []types.Capability) []string
ConvertApplyTo will convert applyTo slice to workload capability name if CRD matches
func HackForStandardTrait ¶
func HackForStandardTrait(tp types.Capability, client client.Client) error
HackForStandardTrait will do some hack install for standard registry
func Info ¶ added in v1.2.0
func Info(app *corev1beta1.Application) string
Info shows the status of each service in the Appfile
func InitApplication ¶
func InitApplication(namespace string, c common.Args, workloadName string, appGroup string) (*api.Application, error)
InitApplication will load Application from cluster
func InstallComponentDefinition ¶ added in v1.1.0
func InstallComponentDefinition(client client.Client, componentData []byte, ioStreams cmdutil.IOStreams, tp *types.Capability) error
InstallComponentDefinition will add a component into K8s cluster and install its controller
func InstallPrometheusInstance ¶
InstallPrometheusInstance will install prometheus instance when the Capability is 'metrics'
func InstallTraitDefinition ¶ added in v1.1.0
func InstallTraitDefinition(client client.Client, mapper discoverymapper.DiscoveryMapper, traitdata []byte, ioStreams cmdutil.IOStreams, cap *types.Capability) error
InstallTraitDefinition will add a trait into K8s cluster and install it's controller
func IsAppfile ¶ added in v1.2.0
IsAppfile check if a file is Appfile format or application format, return true if it's appfile, false means application object
func ListRawWorkloadDefinitions ¶
func ListRawWorkloadDefinitions(userNamespace string, c common.Args) ([]v1beta1.WorkloadDefinition, error)
ListRawWorkloadDefinitions will list raw definition
func LoadAppFile ¶ added in v1.2.0
LoadAppFile will load vela appfile from remote URL or local file system.
func Parse ¶
Parse will parse applyTo(with format Group/Version.Kind) to crd name by just calculate the plural of kind word. TODO we should use discoverymapper instead of calculate plural
func ReadRemoteOrLocalPath ¶ added in v1.2.0
ReadRemoteOrLocalPath will read a path remote or locally
Types ¶
type AppfileOptions ¶
AppfileOptions is some configuration that modify options for an Appfile
func (*AppfileOptions) ApplyApp ¶
func (o *AppfileOptions) ApplyApp(app *corev1beta1.Application, scopes []oam.Object) error
ApplyApp applys config resources for the app. It differs by create and update:
- for create, it displays app status along with information of url, metrics, ssh, logging.
- for update, it rolls out a canary deployment and prints its information. User can verify the canary deployment. This will wait for user approval. If approved, it continues upgrading the whole; otherwise, it would rollback.
func (*AppfileOptions) BaseAppFileRun ¶
func (o *AppfileOptions) BaseAppFileRun(result *BuildResult, args common.Args) error
BaseAppFileRun starts an application according to Appfile
func (*AppfileOptions) Export ¶
func (o *AppfileOptions) Export(filePath, namespace string, quiet bool, c common.Args) (*BuildResult, []byte, error)
Export export Application object from the path of Appfile
func (*AppfileOptions) ExportFromAppFile ¶
func (o *AppfileOptions) ExportFromAppFile(app *api.AppFile, namespace string, quiet bool, c common.Args) (*BuildResult, []byte, error)
ExportFromAppFile exports Application from appfile object
type BuildResult ¶
type BuildResult struct {
// contains filtered or unexported fields
}
BuildResult is the export struct from AppFile yaml or AppFile object
type DeleteOptions ¶
type DeleteOptions struct { Namespace string AppName string CompName string Client client.Client C common.Args Wait bool ForceDelete bool }
DeleteOptions is options for delete
func (*DeleteOptions) DeleteApp ¶
func (o *DeleteOptions) DeleteApp(io cmdutil.IOStreams) error
DeleteApp will delete app including server side
func (*DeleteOptions) DeleteAppWithoutDoubleCheck ¶ added in v1.2.0
func (o *DeleteOptions) DeleteAppWithoutDoubleCheck(io cmdutil.IOStreams) error
DeleteAppWithoutDoubleCheck delete application without double check
func (*DeleteOptions) DeleteComponent ¶
func (o *DeleteOptions) DeleteComponent(io cmdutil.IOStreams) error
DeleteComponent will delete one component including server side.
func (*DeleteOptions) ForceDeleteApp ¶ added in v1.2.0
func (o *DeleteOptions) ForceDeleteApp(io cmdutil.IOStreams) error
ForceDeleteApp force delete the application
func (*DeleteOptions) WaitUntilDeleteApp ¶ added in v1.2.0
func (o *DeleteOptions) WaitUntilDeleteApp(io cmdutil.IOStreams) error
WaitUntilDeleteApp will wait until the application is completely deleted