Documentation ¶
Index ¶
- func StoreAppMeta(ctx context.Context, app *DataStoreApp, ds datastore.DataStore) error
- func StoreApplicationRevision(ctx context.Context, dsApp *DataStoreApp, ds datastore.DataStore) error
- func StoreComponents(ctx context.Context, appPrimaryKey string, ...) error
- func StoreEnv(ctx context.Context, app *DataStoreApp, ds datastore.DataStore, ...) error
- func StoreEnvBinding(ctx context.Context, eb *model.EnvBinding, ds datastore.DataStore) error
- func StorePolicy(ctx context.Context, appPrimaryKey string, ...) error
- func StoreProject(ctx context.Context, project v1.CreateProjectRequest, ds datastore.DataStore, ...) error
- func StoreTargets(ctx context.Context, dsApp *DataStoreApp, ds datastore.DataStore, ...) error
- func StoreWorkflow(ctx context.Context, dsApp *DataStoreApp, ds datastore.DataStore) error
- func StoreWorkflowRecord(ctx context.Context, dsApp *DataStoreApp, ds datastore.DataStore) error
- type ApplicationSync
- type CR2UX
- type DataStoreApp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StoreAppMeta ¶
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 ¶
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) 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 ¶
StoreWorkflow will sync workflow application CR to datastore, it updates the only one workflow from the application with specified name
func StoreWorkflowRecord ¶
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:""` 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
type CR2UX ¶
type CR2UX struct {
// contains filtered or unexported fields
}
CR2UX provides the Add/Update/Delete method
func (*CR2UX) AddOrUpdate ¶
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
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