sync

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StoreAppMeta

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

StoreAppMeta will sync application metadata from CR to datastore

func StoreApplicationRevision

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

StoreApplicationRevision will sync the application revision 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 *DataStoreApp, ds datastore.DataStore, envService service.EnvService) 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, project v1.CreateProjectRequest, ds datastore.DataStore, projectService service.ProjectService, userService service.UserService) error

StoreProject will create project for synced application

func StoreTargets

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

StoreTargets will sync targets from application CR to datastore

func StoreWorkflow

func StoreWorkflow(ctx context.Context, dsApp *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

func StoreWorkflowRecord

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

StoreWorkflowRecord will sync workflow status to datastore.

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:""`
	UserService        service.UserService        `inject:""`
	ApplicationService service.ApplicationService `inject:""`
	WorkflowService    service.WorkflowService    `inject:""`
	TargetService      service.TargetService      `inject:""`
	EnvService         service.EnvService         `inject:""`
	Queue              workqueue.RateLimitingInterface
}

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) ConvertApp2DatastoreApp

func (c *CR2UX) ConvertApp2DatastoreApp(ctx context.Context, targetApp *v1beta1.Application) (*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 DataStoreApp

type DataStoreApp struct {
	Project  *v1.CreateProjectRequest
	AppMeta  *model.Application
	Env      *model.Env
	Eb       *model.EnvBinding
	Comps    []*model.ApplicationComponent
	Policies []*model.ApplicationPolicy
	Workflow *model.Workflow
	Targets  []*model.Target
	Record   *model.WorkflowRecord
	Revision *model.ApplicationRevision
}

DataStoreApp is a memory struct that describes the model of an application in datastore

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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