appfile

package
v1.1.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0 Imports: 31 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) ([]v1beta1.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 Delete

func Delete(envName, appName string) error

Delete will delete an app along with it's appfile.

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 Appfile.

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 Save

func Save(app *api.Application, envName string) error

Save will save appfile into default dir.

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

type Storage

type Storage struct {
	api.Driver
}

Storage is common storage client,use it to get app and others resource

func GetStorage

func GetStorage() *Storage

GetStorage will create storage driver from the system environment of "STORAGE_DRIVER"

func (*Storage) Delete

func (s *Storage) Delete(envName, appName string) error

Delete application storage common implement

func (*Storage) Save

func (s *Storage) Save(app *api.Application, envName string) error

Save application storage common implement

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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