chartConfig

package
v0.7.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigMapAppModel

type ConfigMapAppModel struct {
	TableName     struct{} `sql:"config_map_app_level" pg:",discard_unknown_columns"`
	Id            int      `sql:"id,pk"`
	AppId         int      `sql:"app_id,notnull"`
	ConfigMapData string   `sql:"config_map_data"`
	SecretData    string   `sql:"secret_data"`
	sql.AuditLog
}

type ConfigMapEnvModel

type ConfigMapEnvModel struct {
	TableName     struct{} `sql:"config_map_env_level" pg:",discard_unknown_columns"`
	Id            int      `sql:"id,pk"`
	AppId         int      `sql:"app_id,notnull"`
	EnvironmentId int      `sql:"environment_id,notnull"`
	ConfigMapData string   `sql:"config_map_data"`
	SecretData    string   `sql:"secret_data"`
	Deleted       bool     `sql:"deleted,notnull"`
	sql.AuditLog
}

type ConfigMapRepository

type ConfigMapRepository interface {
	CreateAppLevel(model *ConfigMapAppModel) (*ConfigMapAppModel, error)
	GetByIdAppLevel(id int) (*ConfigMapAppModel, error)
	GetAllAppLevel() ([]ConfigMapAppModel, error)
	UpdateAppLevel(model *ConfigMapAppModel) (*ConfigMapAppModel, error)

	CreateEnvLevel(model *ConfigMapEnvModel) (*ConfigMapEnvModel, error)
	GetByIdEnvLevel(id int) (*ConfigMapEnvModel, error)
	GetAllEnvLevel() ([]ConfigMapEnvModel, error)
	UpdateEnvLevel(model *ConfigMapEnvModel) (*ConfigMapEnvModel, error)

	GetByAppIdAppLevel(appId int) (*ConfigMapAppModel, error)
	GetByAppIdAndEnvIdEnvLevel(appId int, envId int) (*ConfigMapEnvModel, error)
	GetEnvLevelByAppId(appId int) ([]*ConfigMapEnvModel, error)
}

type ConfigMapRepositoryImpl

type ConfigMapRepositoryImpl struct {
	Logger *zap.SugaredLogger
	// contains filtered or unexported fields
}

func NewConfigMapRepositoryImpl

func NewConfigMapRepositoryImpl(Logger *zap.SugaredLogger, dbConnection *pg.DB) *ConfigMapRepositoryImpl

func (ConfigMapRepositoryImpl) CreateAppLevel

func (impl ConfigMapRepositoryImpl) CreateAppLevel(model *ConfigMapAppModel) (*ConfigMapAppModel, error)

func (ConfigMapRepositoryImpl) CreateEnvLevel

func (impl ConfigMapRepositoryImpl) CreateEnvLevel(model *ConfigMapEnvModel) (*ConfigMapEnvModel, error)

func (ConfigMapRepositoryImpl) GetAllAppLevel

func (impl ConfigMapRepositoryImpl) GetAllAppLevel() ([]ConfigMapAppModel, error)

func (ConfigMapRepositoryImpl) GetAllEnvLevel

func (impl ConfigMapRepositoryImpl) GetAllEnvLevel() ([]ConfigMapEnvModel, error)

func (ConfigMapRepositoryImpl) GetByAppIdAndEnvIdEnvLevel

func (impl ConfigMapRepositoryImpl) GetByAppIdAndEnvIdEnvLevel(appId int, envId int) (*ConfigMapEnvModel, error)

func (ConfigMapRepositoryImpl) GetByAppIdAppLevel

func (impl ConfigMapRepositoryImpl) GetByAppIdAppLevel(appId int) (*ConfigMapAppModel, error)

func (ConfigMapRepositoryImpl) GetByIdAppLevel

func (impl ConfigMapRepositoryImpl) GetByIdAppLevel(id int) (*ConfigMapAppModel, error)

func (ConfigMapRepositoryImpl) GetByIdEnvLevel

func (impl ConfigMapRepositoryImpl) GetByIdEnvLevel(id int) (*ConfigMapEnvModel, error)

func (ConfigMapRepositoryImpl) GetEnvLevelByAppId added in v0.3.21

func (impl ConfigMapRepositoryImpl) GetEnvLevelByAppId(appId int) ([]*ConfigMapEnvModel, error)

func (ConfigMapRepositoryImpl) UpdateAppLevel

func (impl ConfigMapRepositoryImpl) UpdateAppLevel(model *ConfigMapAppModel) (*ConfigMapAppModel, error)

func (ConfigMapRepositoryImpl) UpdateEnvLevel

func (impl ConfigMapRepositoryImpl) UpdateEnvLevel(model *ConfigMapEnvModel) (*ConfigMapEnvModel, error)

type EnvConfigOverride

type EnvConfigOverride struct {
	Id                int                `sql:"id,pk"`
	ChartId           int                `sql:"chart_id,notnull"`
	TargetEnvironment int                `sql:"target_environment,notnull"` //target environment
	EnvOverrideValues string             `sql:"env_override_yaml,notnull"`
	Status            models.ChartStatus `sql:"status,notnull"` //new, deployment-in-progress, error, rollbacked, su
	ManualReviewed    bool               `sql:"reviewed,notnull"`
	Active            bool               `sql:"active,notnull"`
	Namespace         string             `sql:"namespace,notnull"`
	Chart             *chartRepoRepository.Chart
	Environment       *repository.Environment     `sql:"-"`
	Latest            bool                        `sql:"latest,notnull"`
	Previous          bool                        `sql:"previous,notnull"`
	IsOverride        bool                        `sql:"is_override,notnull"`
	IsBasicViewLocked bool                        `sql:"is_basic_view_locked,notnull"`
	CurrentViewEditor models.ChartsViewEditorType `sql:"current_view_editor"`
	sql.AuditLog
	ResolvedEnvOverrideValues string            `sql:"-"`
	VariableSnapshot          map[string]string `sql:"-"`
	//ResolvedEnvOverrideValuesForCM string            `sql:"-"`
	VariableSnapshotForCM map[string]string `sql:"-"`
	//ResolvedEnvOverrideValuesForCS string            `sql:"-"`
	VariableSnapshotForCS map[string]string `sql:"-"`
	// contains filtered or unexported fields
}

type EnvConfigOverrideRepository

type EnvConfigOverrideRepository interface {
	Save(*EnvConfigOverride) error
	GetByChartAndEnvironment(chartId, targetEnvironmentId int) (*EnvConfigOverride, error)
	ActiveEnvConfigOverride(appId, environmentId int) (*EnvConfigOverride, error) //successful env config
	GetByIdIncludingInactive(id int) (*EnvConfigOverride, error)
	//this api updates only EnvOverrideValues, EnvMergedValues, Status, ManualReviewed, active based on id
	UpdateProperties(config *EnvConfigOverride) error
	GetByEnvironment(targetEnvironmentId int) ([]EnvConfigOverride, error)

	GetEnvConfigByChartId(chartId int) ([]EnvConfigOverride, error)
	UpdateEnvConfigStatus(config *EnvConfigOverride) error
	Delete(envConfigOverride *EnvConfigOverride) error
	FindLatestChartForAppByAppIdAndEnvId(appId, targetEnvironmentId int) (*EnvConfigOverride, error)
	FindChartRefIdsForLatestChartForAppByAppIdAndEnvIds(appId int, targetEnvironmentIds []int) (map[int]int, error)
	FindChartByAppIdAndEnvIdAndChartRefId(appId, targetEnvironmentId int, chartRefId int) (*EnvConfigOverride, error)
	Update(envConfigOverride *EnvConfigOverride) (*EnvConfigOverride, error)
	FindChartForAppByAppIdAndEnvId(appId, targetEnvironmentId int) (*EnvConfigOverride, error)
	SaveWithTxn(model *EnvConfigOverride, tx *pg.Tx) error
	UpdateWithTxn(envConfigOverride *EnvConfigOverride, tx *pg.Tx) (*EnvConfigOverride, error)

	GetByAppIdEnvIdAndChartRefId(appId, envId int, chartRefId int) (*EnvConfigOverride, error)
}

type EnvConfigOverrideRepositoryImpl

type EnvConfigOverrideRepositoryImpl struct {
	// contains filtered or unexported fields
}

func NewEnvConfigOverrideRepository

func NewEnvConfigOverrideRepository(dbConnection *pg.DB) *EnvConfigOverrideRepositoryImpl

func (EnvConfigOverrideRepositoryImpl) ActiveEnvConfigOverride

func (r EnvConfigOverrideRepositoryImpl) ActiveEnvConfigOverride(appId, environmentId int) (*EnvConfigOverride, error)

func (EnvConfigOverrideRepositoryImpl) Delete

func (r EnvConfigOverrideRepositoryImpl) Delete(envConfigOverride *EnvConfigOverride) error

func (EnvConfigOverrideRepositoryImpl) FindChartByAppIdAndEnvIdAndChartRefId

func (r EnvConfigOverrideRepositoryImpl) FindChartByAppIdAndEnvIdAndChartRefId(appId, targetEnvironmentId int, chartRefId int) (*EnvConfigOverride, error)

func (EnvConfigOverrideRepositoryImpl) FindChartForAppByAppIdAndEnvId

func (r EnvConfigOverrideRepositoryImpl) FindChartForAppByAppIdAndEnvId(appId, targetEnvironmentId int) (*EnvConfigOverride, error)

func (EnvConfigOverrideRepositoryImpl) FindChartRefIdsForLatestChartForAppByAppIdAndEnvIds added in v0.6.17

func (r EnvConfigOverrideRepositoryImpl) FindChartRefIdsForLatestChartForAppByAppIdAndEnvIds(appId int, targetEnvironmentIds []int) (map[int]int, error)

func (EnvConfigOverrideRepositoryImpl) FindLatestChartForAppByAppIdAndEnvId

func (r EnvConfigOverrideRepositoryImpl) FindLatestChartForAppByAppIdAndEnvId(appId, targetEnvironmentId int) (*EnvConfigOverride, error)

func (EnvConfigOverrideRepositoryImpl) GetByAppIdEnvIdAndChartRefId added in v0.6.2

func (r EnvConfigOverrideRepositoryImpl) GetByAppIdEnvIdAndChartRefId(appId, envId, chartRefId int) (*EnvConfigOverride, error)

func (EnvConfigOverrideRepositoryImpl) GetByChartAndEnvironment

func (r EnvConfigOverrideRepositoryImpl) GetByChartAndEnvironment(chartId, targetEnvironmentId int) (*EnvConfigOverride, error)

func (EnvConfigOverrideRepositoryImpl) GetByEnvironment

func (r EnvConfigOverrideRepositoryImpl) GetByEnvironment(targetEnvironmentId int) ([]EnvConfigOverride, error)

func (EnvConfigOverrideRepositoryImpl) GetByIdIncludingInactive added in v0.7.1

func (r EnvConfigOverrideRepositoryImpl) GetByIdIncludingInactive(id int) (*EnvConfigOverride, error)

func (EnvConfigOverrideRepositoryImpl) GetEnvConfigByChartId

func (r EnvConfigOverrideRepositoryImpl) GetEnvConfigByChartId(chartId int) ([]EnvConfigOverride, error)

func (EnvConfigOverrideRepositoryImpl) Save

func (EnvConfigOverrideRepositoryImpl) SaveWithTxn added in v0.2.27

func (r EnvConfigOverrideRepositoryImpl) SaveWithTxn(override *EnvConfigOverride, tx *pg.Tx) error

func (EnvConfigOverrideRepositoryImpl) Update

func (EnvConfigOverrideRepositoryImpl) UpdateEnvConfigStatus

func (r EnvConfigOverrideRepositoryImpl) UpdateEnvConfigStatus(config *EnvConfigOverride) error

func (EnvConfigOverrideRepositoryImpl) UpdateProperties

func (r EnvConfigOverrideRepositoryImpl) UpdateProperties(config *EnvConfigOverride) error

this api updates only EnvOverrideValues, EnvMergedValues, Status, ManualReviewed, active based on id

func (EnvConfigOverrideRepositoryImpl) UpdateWithTxn added in v0.2.27

func (r EnvConfigOverrideRepositoryImpl) UpdateWithTxn(envConfigOverride *EnvConfigOverride, tx *pg.Tx) (*EnvConfigOverride, error)

type PipelineConfigOverrideMetadata added in v0.7.0

type PipelineConfigOverrideMetadata struct {
	AppId            int
	MergedValuesYaml string
}

type PipelineConfigRepository

type PipelineConfigRepository interface {
	Save(pipelineStrategy *PipelineStrategy, tx *pg.Tx) error
	Update(pipelineStrategy *PipelineStrategy, tx *pg.Tx) error
	FindById(id int) (chart *PipelineStrategy, err error)
	FindByStrategy(strategy chartRepoRepository.DeploymentStrategy) (pipelineStrategy *PipelineStrategy, err error)
	FindByStrategyAndPipelineId(strategy chartRepoRepository.DeploymentStrategy, pipelineId int) (pipelineStrategy *PipelineStrategy, err error)
	GetAllStrategyByPipelineId(pipelineId int) ([]*PipelineStrategy, error)
	GetDefaultStrategyByPipelineId(pipelineId int) (pipelineStrategy *PipelineStrategy, err error)
	Delete(pipelineStrategy *PipelineStrategy, tx *pg.Tx) error
	GetAllStrategyByPipelineIds(pipelineIds []int) ([]*PipelineStrategy, error)
}

type PipelineConfigRepositoryImpl

type PipelineConfigRepositoryImpl struct {
	// contains filtered or unexported fields
}

func NewPipelineConfigRepository

func NewPipelineConfigRepository(dbConnection *pg.DB) *PipelineConfigRepositoryImpl

func (PipelineConfigRepositoryImpl) Delete

func (impl PipelineConfigRepositoryImpl) Delete(pipelineStrategy *PipelineStrategy, tx *pg.Tx) error

func (PipelineConfigRepositoryImpl) FindById

func (impl PipelineConfigRepositoryImpl) FindById(id int) (pipelineStrategy *PipelineStrategy, err error)

func (PipelineConfigRepositoryImpl) FindByStrategy

func (impl PipelineConfigRepositoryImpl) FindByStrategy(strategy chartRepoRepository.DeploymentStrategy) (pipelineStrategy *PipelineStrategy, err error)

func (PipelineConfigRepositoryImpl) FindByStrategyAndPipelineId

func (impl PipelineConfigRepositoryImpl) FindByStrategyAndPipelineId(strategy chartRepoRepository.DeploymentStrategy, pipelineId int) (pipelineStrategy *PipelineStrategy, err error)

func (PipelineConfigRepositoryImpl) GetAllStrategyByPipelineId

func (impl PipelineConfigRepositoryImpl) GetAllStrategyByPipelineId(pipelineId int) ([]*PipelineStrategy, error)

it will return for multiple pipeline config for pipeline, per pipeline single pipeline config(blue green, canary)

func (PipelineConfigRepositoryImpl) GetAllStrategyByPipelineIds added in v0.6.15

func (impl PipelineConfigRepositoryImpl) GetAllStrategyByPipelineIds(pipelineIds []int) ([]*PipelineStrategy, error)

func (PipelineConfigRepositoryImpl) GetDefaultStrategyByPipelineId

func (impl PipelineConfigRepositoryImpl) GetDefaultStrategyByPipelineId(pipelineId int) (pipelineStrategy *PipelineStrategy, err error)

it will return single latest pipeline config for requested pipeline

func (PipelineConfigRepositoryImpl) Save

func (impl PipelineConfigRepositoryImpl) Save(pipelineStrategy *PipelineStrategy, tx *pg.Tx) error

func (PipelineConfigRepositoryImpl) Update

func (impl PipelineConfigRepositoryImpl) Update(pipelineStrategy *PipelineStrategy, tx *pg.Tx) error

type PipelineOverride

type PipelineOverride struct {
	Id                     int                   `sql:"id,pk"`
	RequestIdentifier      string                `sql:"request_identifier,unique,notnull"`
	EnvConfigOverrideId    int                   `sql:"env_config_override_id,notnull"`
	PipelineOverrideValues string                `sql:"pipeline_override_yaml,notnull"`
	PipelineMergedValues   string                `sql:"merged_values_yaml,notnull"` // merge of appOverride, envOverride, pipelineOverride
	Status                 models.ChartStatus    `sql:"status,notnull"`             // new , deployment-in-progress, success, rollbacked
	GitHash                string                `sql:"git_hash"`
	CommitTime             time.Time             `sql:"commit_time,type:timestamptz"`
	PipelineId             int                   `sql:"pipeline_id"`
	CiArtifactId           int                   `sql:"ci_artifact_id"`
	PipelineReleaseCounter int                   `sql:"pipeline_release_counter"` //built index
	CdWorkflowId           int                   `sql:"cd_workflow_id"`           //built index
	DeploymentType         models.DeploymentType `sql:"deployment_type"`          // deployment type
	sql.AuditLog
	EnvConfigOverride *EnvConfigOverride
	CiArtifact        *repository.CiArtifact
	Pipeline          *pipelineConfig.Pipeline
	// contains filtered or unexported fields
}

type PipelineOverrideRepository

type PipelineOverrideRepository interface {
	Save(*PipelineOverride) error
	Update(pipelineOverride *PipelineOverride) error
	UpdateStatusByRequestIdentifier(requestId string, newStatus models.ChartStatus) (int, error)
	GetLatestConfigByRequestIdentifier(requestIdentifier string) (pipelineOverride *PipelineOverride, err error)
	GetLatestConfigByEnvironmentConfigOverrideId(envConfigOverrideId int) (pipelineOverride *PipelineOverride, err error)
	UpdatePipelineMergedValues(ctx context.Context, tx *pg.Tx, id int, pipelineMergedValues string, userId int32) error
	UpdateCommitDetails(ctx context.Context, tx *pg.Tx, id int, gitHash string, commitTime time.Time, userId int32) error
	GetCurrentPipelineReleaseCounter(pipelineId int) (releaseCounter int, err error)
	GetByPipelineIdAndReleaseNo(pipelineId, releaseNo int) (pipelineOverrides []*PipelineOverride, err error)
	GetAllRelease(appId, environmentId int) (pipelineOverrides []*PipelineOverride, err error)
	FindByPipelineTriggerGitHash(gitHash string) (pipelineOverride *PipelineOverride, err error)
	GetLatestRelease(appId, environmentId int) (pipelineOverrides *PipelineOverride, err error)
	GetLatestReleaseForAppIds(appIds []int, envId int) (pipelineOverrides []*PipelineConfigOverrideMetadata, err error)
	FindById(id int) (*PipelineOverride, error)
	GetByDeployedImage(appId, environmentId int, images []string) (pipelineOverride *PipelineOverride, err error)
	GetLatestReleaseByPipelineIds(pipelineIds []int) (pipelineOverrides []*PipelineOverride, err error)
	GetLatestReleaseDeploymentType(pipelineIds []int) ([]*PipelineOverride, error)
	FindLatestByAppIdAndEnvId(appId, environmentId int, deploymentAppType string) (pipelineOverrides *PipelineOverride, err error)
	FindLatestByCdWorkflowId(cdWorkflowId int) (pipelineOverride *PipelineOverride, err error)
}

type PipelineOverrideRepositoryImpl

type PipelineOverrideRepositoryImpl struct {
	// contains filtered or unexported fields
}

func NewPipelineOverrideRepository

func NewPipelineOverrideRepository(dbConnection *pg.DB) *PipelineOverrideRepositoryImpl

func (PipelineOverrideRepositoryImpl) FindById

func (PipelineOverrideRepositoryImpl) FindByPipelineTriggerGitHash

func (impl PipelineOverrideRepositoryImpl) FindByPipelineTriggerGitHash(gitHash string) (pipelineOverride *PipelineOverride, err error)

func (PipelineOverrideRepositoryImpl) FindLatestByAppIdAndEnvId added in v0.6.4

func (impl PipelineOverrideRepositoryImpl) FindLatestByAppIdAndEnvId(appId, environmentId int, deploymentAppType string) (pipelineOverrides *PipelineOverride, err error)

func (PipelineOverrideRepositoryImpl) FindLatestByCdWorkflowId added in v0.6.12

func (impl PipelineOverrideRepositoryImpl) FindLatestByCdWorkflowId(cdWorkflowId int) (*PipelineOverride, error)

func (PipelineOverrideRepositoryImpl) GetAllRelease

func (impl PipelineOverrideRepositoryImpl) GetAllRelease(appId, environmentId int) (pipelineOverrides []*PipelineOverride, err error)

func (PipelineOverrideRepositoryImpl) GetByDeployedImage

func (impl PipelineOverrideRepositoryImpl) GetByDeployedImage(appId, environmentId int, images []string) (pipelineOverride *PipelineOverride, err error)

func (PipelineOverrideRepositoryImpl) GetByPipelineIdAndReleaseNo

func (impl PipelineOverrideRepositoryImpl) GetByPipelineIdAndReleaseNo(pipelineId, releaseNo int) (pipelineOverrides []*PipelineOverride, err error)

func (PipelineOverrideRepositoryImpl) GetCurrentPipelineReleaseCounter

func (impl PipelineOverrideRepositoryImpl) GetCurrentPipelineReleaseCounter(pipelineId int) (releaseCounter int, err error)

func (PipelineOverrideRepositoryImpl) GetLatestConfigByEnvironmentConfigOverrideId

func (impl PipelineOverrideRepositoryImpl) GetLatestConfigByEnvironmentConfigOverrideId(envConfigOverrideId int) (pipelineOverride *PipelineOverride, err error)

func (PipelineOverrideRepositoryImpl) GetLatestConfigByRequestIdentifier

func (impl PipelineOverrideRepositoryImpl) GetLatestConfigByRequestIdentifier(requestIdentifier string) (pipelineOverride *PipelineOverride, err error)

func (PipelineOverrideRepositoryImpl) GetLatestRelease

func (impl PipelineOverrideRepositoryImpl) GetLatestRelease(appId, environmentId int) (pipelineOverrides *PipelineOverride, err error)

func (PipelineOverrideRepositoryImpl) GetLatestReleaseByPipelineIds

func (impl PipelineOverrideRepositoryImpl) GetLatestReleaseByPipelineIds(pipelineIds []int) (pipelineOverrides []*PipelineOverride, err error)

func (PipelineOverrideRepositoryImpl) GetLatestReleaseDeploymentType

func (impl PipelineOverrideRepositoryImpl) GetLatestReleaseDeploymentType(pipelineIds []int) ([]*PipelineOverride, error)

func (PipelineOverrideRepositoryImpl) GetLatestReleaseForAppIds added in v0.7.0

func (impl PipelineOverrideRepositoryImpl) GetLatestReleaseForAppIds(appIds []int, envId int) (pipelineOverrideMetadata []*PipelineConfigOverrideMetadata, err error)

func (PipelineOverrideRepositoryImpl) Save

func (impl PipelineOverrideRepositoryImpl) Save(pipelineOverride *PipelineOverride) error

func (PipelineOverrideRepositoryImpl) Update

func (impl PipelineOverrideRepositoryImpl) Update(pipelineOverride *PipelineOverride) error

func (PipelineOverrideRepositoryImpl) UpdateCommitDetails added in v0.7.1

func (impl PipelineOverrideRepositoryImpl) UpdateCommitDetails(ctx context.Context, tx *pg.Tx, id int, gitHash string, commitTime time.Time, userId int32) error

func (PipelineOverrideRepositoryImpl) UpdatePipelineMergedValues added in v0.7.1

func (impl PipelineOverrideRepositoryImpl) UpdatePipelineMergedValues(ctx context.Context, tx *pg.Tx, id int, pipelineMergedValues string, userId int32) error

func (PipelineOverrideRepositoryImpl) UpdateStatusByRequestIdentifier

func (impl PipelineOverrideRepositoryImpl) UpdateStatusByRequestIdentifier(requestId string, newStatus models.ChartStatus) (int, error)

type PipelineStrategy

type PipelineStrategy struct {
	Id         int                                    `sql:"id,pk"`
	PipelineId int                                    `sql:"pipeline_id"`
	Strategy   chartRepoRepository.DeploymentStrategy `sql:"strategy,notnull"`
	Config     string                                 `sql:"config"`
	Default    bool                                   `sql:"default,notnull"`
	Deleted    bool                                   `sql:"deleted,notnull"`
	sql.AuditLog
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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