appfile

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

Documentation

Index

Constants

View Source
const (
	// TerraformBaseLocation is the base directory to store all Terraform JSON files
	TerraformBaseLocation = ".vela/terraform/"
	// TerraformLog is the logfile name for terraform
	TerraformLog = "terraform.log"
)

Variables

This section is empty.

Functions

func ApplyTerraform

func ApplyTerraform(app *v1beta1.Application, k8sClient client.Client, ioStream util.IOStreams, namespace string, args common.Args) ([]commontypes.ApplicationComponent, error)

ApplyTerraform deploys addon resources

func CreateOrUpdateApplication

func CreateOrUpdateApplication(ctx context.Context, client client.Client, app *v1beta1.Application) error

CreateOrUpdateApplication will create if not exist and update if exists.

func CreateOrUpdateObjects

func CreateOrUpdateObjects(ctx context.Context, client client.Client, objects []oam.Object) error

CreateOrUpdateObjects will create all scopes

func GetAppConfig

GetAppConfig will get AppConfig from K8s cluster.

func GetApplicationSettings

func GetApplicationSettings(app *v1beta1.Application, componentName string) (string, map[string]interface{})

GetApplicationSettings will get service type and it's configuration

func GetComponents

func GetComponents(app *v1beta1.Application) []string

GetComponents will get oam components from v1beta1.Application.

func GetServiceConfig

func GetServiceConfig(app *api.Application, componentName string) (string, map[string]interface{})

GetServiceConfig will get service type and it's configuration

func GetTraits

func GetTraits(app *api.Application, componentName string) (map[string]map[string]interface{}, error)

GetTraits will list all traits and it's configurations attached to the specified component.

func GetWorkload

func GetWorkload(app *api.Application, componentName string) (string, map[string]interface{})

GetWorkload will get workload type and it's configuration

func LoadApplication

func LoadApplication(namespace, appName string, c common.Args) (*v1beta1.Application, error)

LoadApplication will load application from cluster.

func NewApplication

func NewApplication(f *api.AppFile, tm template.Manager) *api.Application

NewApplication will create application object

func NewEmptyApplication

func NewEmptyApplication(namespace string, c common.Args) (*api.Application, error)

NewEmptyApplication new empty application, only set tm

func RemoveComponent

func RemoveComponent(app *v1beta1.Application, componentName string) error

RemoveComponent will remove component from Application

func RemoveTrait

func RemoveTrait(app *api.Application, componentName, traitType string) error

RemoveTrait will remove a trait from Appfile

func Run

func Run(ctx context.Context, client client.Client, app *v1beta1.Application, assistantObjects []oam.Object) error

Run will deploy OAM objects and other assistant K8s Objects including ConfigMap, OAM Scope Custom Resource.

func SetTrait

func SetTrait(app *v1beta1.Application, componentName, traitType string, traitData map[string]interface{}) error

SetTrait will set user trait for Appfile

func SetWorkload

func SetWorkload(app *api.Application, componentName, workloadType string, workloadData map[string]interface{}) error

SetWorkload will set user workload for Appfile

func Validate

func Validate(app *api.Application) error

Validate will validate whether an Appfile is valid.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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