sync

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: Apache-2.0 Imports: 26 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 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, projectService service.ProjectService) 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 ApplicationSync

type ApplicationSync struct {
	KubeClient     client.Client          `inject:"kubeClient"`
	KubeConfig     *rest.Config           `inject:"kubeConfig"`
	Store          datastore.DataStore    `inject:"datastore"`
	ProjectService service.ProjectService `inject:""`
}

ApplicationSync sync application from cluster to database

func (*ApplicationSync) Start

func (a *ApplicationSync) Start(ctx context.Context, errorChan chan error)

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

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

type WorkflowRecordSync

type WorkflowRecordSync struct {
	Duration        time.Duration
	WorkflowService service.WorkflowService `inject:""`
}

WorkflowRecordSync sync workflow record from cluster to database

func (*WorkflowRecordSync) Start

func (w *WorkflowRecordSync) Start(ctx context.Context, errorChan chan error)

Start sync workflow record data

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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