Documentation ¶
Index ¶
- func CheckSoTFromCR(targetApp *v1beta1.Application) string
- func StoreAppMeta(ctx context.Context, app *model.DataStoreApp, ds datastore.DataStore) error
- func StoreComponents(ctx context.Context, appPrimaryKey string, ...) error
- func StoreEnv(ctx context.Context, app *model.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, name string, ds datastore.DataStore, ...) error
- func StoreTargets(ctx context.Context, dsApp *model.DataStoreApp, ds datastore.DataStore) error
- func StoreWorkflow(ctx context.Context, dsApp *model.DataStoreApp, ds datastore.DataStore) error
- type ApplicationSync
- type CR2UX
- func (c *CR2UX) AddOrUpdate(ctx context.Context, targetApp *v1beta1.Application) error
- func (c *CR2UX) CheckSoTFromAppMeta(ctx context.Context, appName, namespace string, sotFromCR string) string
- func (c *CR2UX) ConvertApp2DatastoreApp(ctx context.Context, targetApp *v1beta1.Application) (*model.DataStoreApp, error)
- func (c *CR2UX) DeleteApp(ctx context.Context, targetApp *v1beta1.Application) error
- type WorkflowRecordSync
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 ¶
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 ¶
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, name string, ds datastore.DataStore, projectService service.ProjectService) error
StoreProject will create project for synced application
func StoreTargets ¶
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
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
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) 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
type WorkflowRecordSync ¶
type WorkflowRecordSync struct { Duration time.Duration WorkflowService service.WorkflowService `inject:""` }
WorkflowRecordSync sync workflow record from cluster to database