chartConfig

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: Apache-2.0 Imports: 10 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"`
	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"`
	sql.AuditLog
	// 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
	Get(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)
	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)
}

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

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

func (EnvConfigOverrideRepositoryImpl) Get

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) 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 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 pipelineConfig.DeploymentTemplate) (pipelineStrategy *PipelineStrategy, err error)
	FindByStrategyAndPipelineId(strategy pipelineConfig.DeploymentTemplate, 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
}

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 pipelineConfig.DeploymentTemplate) (pipelineStrategy *PipelineStrategy, err error)

func (PipelineConfigRepositoryImpl) FindByStrategyAndPipelineId

func (impl PipelineConfigRepositoryImpl) FindByStrategyAndPipelineId(strategy pipelineConfig.DeploymentTemplate, 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) 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"`
	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
	UpdateStatusByRequestIdentifier(requestId string, newStatus models.ChartStatus) (int, error)
	GetLatestConfigByRequestIdentifier(requestIdentifier string) (pipelineOverride *PipelineOverride, err error)
	GetLatestConfigByEnvironmentConfigOverrideId(envConfigOverrideId int) (pipelineOverride *PipelineOverride, err error)
	Update(pipelineOverride *PipelineOverride) 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)
	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)
}

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

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

func (PipelineOverrideRepositoryImpl) Update

func (impl PipelineOverrideRepositoryImpl) Update(pipelineOverride *PipelineOverride) 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   pipelineConfig.DeploymentTemplate `sql:"strategy,notnull"`
	Config     string                            `sql:"config"`
	Default    bool                              `sql:"default,notnull"`
	Deleted    bool                              `sql:"deleted,notnull"`
	sql.AuditLog
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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