repository

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	// EnvBindingPolicyDefaultName default policy name
	EnvBindingPolicyDefaultName string = "env-bindings"
)

Variables

This section is empty.

Functions

func ConvertWorkflowName

func ConvertWorkflowName(envName string) string

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

func CreateTarget(ctx context.Context, ds datastore.DataStore, tg *model.Target) error

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 added in v1.5.0

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 GetEnv

func GetEnv(ctx context.Context, ds datastore.DataStore, envName string) (*model.Env, error)

GetEnv get the environment

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

func UpdateEnvWorkflow

func UpdateEnvWorkflow(ctx context.Context, kubeClient client.Client, ds datastore.DataStore, app *model.Application, env *model.Env) error

UpdateEnvWorkflow will update env workflow internally

func UpdateWorkflowSteps

func UpdateWorkflowSteps(ctx context.Context, ds datastore.DataStore, workflow *model.Workflow, steps []model.WorkflowStep) error

UpdateWorkflowSteps will update workflow with new steps

Types

type EnvListOption

type EnvListOption struct {
	AppPrimaryKey string
	EnvName       string
	ProjectName   string
}

EnvListOption the option for listing the env

Jump to

Keyboard shortcuts

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