sync

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSoTFromCR

func CheckSoTFromCR(targetApp *v1beta1.Application) string

CheckSoTFromCR will check the source of truth of the application

func Start

func Start(ctx context.Context, ds datastore.DataStore, cfg *rest.Config, usecases map[string]interface{})

Start prepares watchers and run their controllers, then waits for process termination signals

func StoreAppMeta

func StoreAppMeta(ctx context.Context, app *model.DataStoreApp, ds datastore.DataStore) error

StoreAppMeta will sync application metadata from CR to datastore

func StoreComponents

func StoreComponents(ctx context.Context, appPrimaryKey string, expComps []*model.ApplicationComponent, ds datastore.DataStore) error

StoreComponents will sync application components from CR to datastore

func StoreEnv

func StoreEnv(ctx context.Context, app *model.DataStoreApp, ds datastore.DataStore) error

StoreEnv will sync application namespace from CR to datastore env, one namespace belongs to one env

func StoreEnvBinding

func StoreEnvBinding(ctx context.Context, eb *model.EnvBinding, ds datastore.DataStore) error

StoreEnvBinding will add envbinding for application CR one application one envbinding

func StorePolicy

func StorePolicy(ctx context.Context, appPrimaryKey string, expPolicies []*model.ApplicationPolicy, ds datastore.DataStore) error

StorePolicy will add/update/delete policies, we don't delete ref policy

func StoreProject

func StoreProject(ctx context.Context, name string, ds datastore.DataStore, projectUsecase usecase.ProjectUsecase) error

StoreProject will create project for synced application

func StoreTargets

func StoreTargets(ctx context.Context, dsApp *model.DataStoreApp, ds datastore.DataStore) error

StoreTargets will sync targets from application CR to datastore

func StoreWorkflow

func StoreWorkflow(ctx context.Context, dsApp *model.DataStoreApp, ds datastore.DataStore) error

StoreWorkflow will sync workflow application CR to datastore, it updates the only one workflow from the application with specified name

Types

type CR2UX

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

CR2UX provides the Add/Update/Delete method

func (*CR2UX) AddOrUpdate

func (c *CR2UX) AddOrUpdate(ctx context.Context, targetApp *v1beta1.Application) error

AddOrUpdate will sync application CR to storage of VelaUX automatically

func (*CR2UX) CheckSoTFromAppMeta

func (c *CR2UX) CheckSoTFromAppMeta(ctx context.Context, appName, namespace string, sotFromCR string) string

CheckSoTFromAppMeta will check the source of truth marked in datastore

func (*CR2UX) ConvertApp2DatastoreApp

func (c *CR2UX) ConvertApp2DatastoreApp(ctx context.Context, targetApp *v1beta1.Application) (*model.DataStoreApp, error)

ConvertApp2DatastoreApp will convert Application CR to datastore application related resources

func (*CR2UX) DeleteApp

func (c *CR2UX) DeleteApp(ctx context.Context, targetApp *v1beta1.Application) error

DeleteApp will delete the application as the CR was deleted

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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