Documentation ¶
Index ¶
- Constants
- func ConvertWorkflowName(envName string) string
- func CreateEnv(ctx context.Context, kubeClient client.Client, ds datastore.DataStore, ...) error
- func CreateTarget(ctx context.Context, ds datastore.DataStore, tg *model.Target) error
- func CreateTargetNamespace(ctx context.Context, k8sClient client.Client, ...) error
- func DeleteApplicationEnvPolicies(ctx context.Context, store datastore.DataStore, app *model.Application, ...) error
- func DeleteTargetNamespace(ctx context.Context, k8sClient client.Client, ...) error
- func GenEnvWorkflowStepsAndPolicies(ctx context.Context, kubeClient client.Client, ds datastore.DataStore, ...) ([]model.WorkflowStep, []datastore.Entity)
- func GetApplicationRevision(ctx context.Context, store datastore.DataStore, appName, version string) (*model.ApplicationRevision, error)
- func GetComponentDefinition(ctx context.Context, kubeClient client.Client, name string) (*v1beta1.ComponentDefinition, error)
- func GetEnv(ctx context.Context, ds datastore.DataStore, envName string) (*model.Env, error)
- func GetWorkflowByEnv(ctx context.Context, ds datastore.DataStore, app *model.Application, ...) (*model.Workflow, error)
- func GetWorkflowForApp(ctx context.Context, ds datastore.DataStore, app *model.Application, ...) (*model.Workflow, error)
- func HaveTerraformWorkload(ctx context.Context, kubeClient client.Client, components []datastore.Entity) (terraformComponents []*model.ApplicationComponent)
- func ListApplicationCommonPolicies(ctx context.Context, store datastore.DataStore, app *model.Application) (list []*model.ApplicationPolicy, err error)
- func ListApplicationEnvPolicies(ctx context.Context, store datastore.DataStore, app *model.Application, ...) (list []*model.ApplicationPolicy, err error)
- func ListApplicationPolicies(ctx context.Context, store datastore.DataStore, app *model.Application) (list []*model.ApplicationPolicy, err error)
- func ListEnvBindings(ctx context.Context, ds datastore.DataStore, listOption EnvListOption) ([]*model.EnvBinding, error)
- func ListEnvs(ctx context.Context, ds datastore.DataStore, listOption *datastore.ListOptions) ([]*model.Env, error)
- func ListFullEnvBinding(ctx context.Context, ds datastore.DataStore, option EnvListOption) ([]*apisv1.EnvBindingBase, error)
- func ListRoles(ctx context.Context, store datastore.DataStore, projectName string, ...) ([]*model.Role, int64, error)
- func ListTarget(ctx context.Context, ds datastore.DataStore, project string, ...) ([]*model.Target, error)
- func ListWorkflowForApp(ctx context.Context, ds datastore.DataStore, appPrimaryKey string) ([]*model.Workflow, error)
- func UpdateAppEnvWorkflow(ctx context.Context, kubeClient client.Client, ds datastore.DataStore, ...) error
- func UpdateEnvWorkflow(ctx context.Context, kubeClient client.Client, ds datastore.DataStore, ...) error
- func UpdateWorkflowSteps(ctx context.Context, ds datastore.DataStore, workflow *model.Workflow, ...) error
- type EnvListOption
Constants ¶
const ( // Deploy2Env deploy app to target cluster, suitable for common applications Deploy2Env string = "deploy2env" // DeployCloudResource deploy app to local and copy secret to target cluster, suitable for cloud application. DeployCloudResource string = "deploy-cloud-resource" // TerraformWorkloadType cloud application TerraformWorkloadType string = "configurations.terraform.core.oam.dev" // TerraformWorkloadKind terraform workload kind TerraformWorkloadKind string = "Configuration" )
const ( // EnvBindingPolicyDefaultName default policy name EnvBindingPolicyDefaultName string = "env-bindings" )
Variables ¶
This section is empty.
Functions ¶
func ConvertWorkflowName ¶
ConvertWorkflowName generate the workflow name
func CreateEnv ¶
func CreateEnv(ctx context.Context, kubeClient client.Client, ds datastore.DataStore, env *model.Env) error
CreateEnv create the environment
func CreateTarget ¶
CreateTarget create a target
func CreateTargetNamespace ¶
func CreateTargetNamespace(ctx context.Context, k8sClient client.Client, clusterName, namespace, targetName string) error
CreateTargetNamespace create the namespace of the target
func DeleteApplicationEnvPolicies ¶
func DeleteApplicationEnvPolicies(ctx context.Context, store datastore.DataStore, app *model.Application, envName string) error
DeleteApplicationEnvPolicies delete the policies via app name and env name
func DeleteTargetNamespace ¶
func DeleteTargetNamespace(ctx context.Context, k8sClient client.Client, clusterName, namespace, targetName string) error
DeleteTargetNamespace delete the namespace of the target
func GenEnvWorkflowStepsAndPolicies ¶
func GenEnvWorkflowStepsAndPolicies(ctx context.Context, kubeClient client.Client, ds datastore.DataStore, env *model.Env, app *model.Application) ([]model.WorkflowStep, []datastore.Entity)
GenEnvWorkflowStepsAndPolicies will generate workflow steps and policies for an env and application
func GetApplicationRevision ¶
func GetApplicationRevision(ctx context.Context, store datastore.DataStore, appName, version string) (*model.ApplicationRevision, error)
GetApplicationRevision get the application revision If the version is empty, will query the latest revision of the application
func GetComponentDefinition ¶
func GetComponentDefinition(ctx context.Context, kubeClient client.Client, name string) (*v1beta1.ComponentDefinition, error)
GetComponentDefinition will get componentDefinition by kube client
func GetWorkflowByEnv ¶
func GetWorkflowByEnv(ctx context.Context, ds datastore.DataStore, app *model.Application, envName string) (*model.Workflow, error)
GetWorkflowByEnv get the workflow by specified environment name.
func GetWorkflowForApp ¶
func GetWorkflowForApp(ctx context.Context, ds datastore.DataStore, app *model.Application, workflowName string) (*model.Workflow, error)
GetWorkflowForApp get the specified workflow of the application
func HaveTerraformWorkload ¶
func HaveTerraformWorkload(ctx context.Context, kubeClient client.Client, components []datastore.Entity) (terraformComponents []*model.ApplicationComponent)
HaveTerraformWorkload there is at least one component with terraform workload
func ListApplicationCommonPolicies ¶
func ListApplicationCommonPolicies(ctx context.Context, store datastore.DataStore, app *model.Application) (list []*model.ApplicationPolicy, err error)
ListApplicationCommonPolicies list the policies that common to all environments
func ListApplicationEnvPolicies ¶
func ListApplicationEnvPolicies(ctx context.Context, store datastore.DataStore, app *model.Application, envName string) (list []*model.ApplicationPolicy, err error)
ListApplicationEnvPolicies list the policies that only belong to the specified env
func ListApplicationPolicies ¶
func ListApplicationPolicies(ctx context.Context, store datastore.DataStore, app *model.Application) (list []*model.ApplicationPolicy, err error)
ListApplicationPolicies query the application policies
func ListEnvBindings ¶
func ListEnvBindings(ctx context.Context, ds datastore.DataStore, listOption EnvListOption) ([]*model.EnvBinding, error)
ListEnvBindings list the envbinding
func ListEnvs ¶
func ListEnvs(ctx context.Context, ds datastore.DataStore, listOption *datastore.ListOptions) ([]*model.Env, error)
ListEnvs list the environments
func ListFullEnvBinding ¶
func ListFullEnvBinding(ctx context.Context, ds datastore.DataStore, option EnvListOption) ([]*apisv1.EnvBindingBase, error)
ListFullEnvBinding list the envbinding and convert to DTO
func ListRoles ¶
func ListRoles(ctx context.Context, store datastore.DataStore, projectName string, page, pageSize int) ([]*model.Role, int64, error)
ListRoles list roles from store
func ListTarget ¶
func ListTarget(ctx context.Context, ds datastore.DataStore, project string, dsOption *datastore.ListOptions) ([]*model.Target, error)
ListTarget list the targets
func ListWorkflowForApp ¶
func ListWorkflowForApp(ctx context.Context, ds datastore.DataStore, appPrimaryKey string) ([]*model.Workflow, error)
ListWorkflowForApp list all workflows of the application
func UpdateAppEnvWorkflow ¶
func UpdateAppEnvWorkflow(ctx context.Context, kubeClient client.Client, ds datastore.DataStore, app *model.Application) error
UpdateAppEnvWorkflow will update the all env workflows internally of the specified app
Types ¶
type EnvListOption ¶
EnvListOption the option for listing the env