chart

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 32 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReservedChartRefNamesList *[]ReservedChartList

Functions

func PatchWinterSoldierConfig added in v0.6.21

func PatchWinterSoldierConfig(override json.RawMessage, newChartType string) (json.RawMessage, error)

func PatchWinterSoldierIfExists added in v0.6.21

func PatchWinterSoldierIfExists(newChartType string, jsonMap map[string]json.RawMessage) (map[string]json.RawMessage, error)

Types

type AppConfigResponse

type AppConfigResponse struct {
	//DefaultAppConfig  json.RawMessage `json:"defaultAppConfig"`
	//AppConfig         TemplateRequest            `json:"appConfig"`
	LatestAppConfig   TemplateRequest `json:"latestAppConfig"`
	PreviousAppConfig TemplateRequest `json:"previousAppConfig"`
}

type ChartRefChangeRequest added in v0.6.21

type ChartRefChangeRequest struct {
	AppId            int `json:"appId" validate:"required"`
	EnvId            int `json:"envId" validate:"required"`
	TargetChartRefId int `json:"targetChartRefId" validate:"required"`
}

type ChartService

type ChartService interface {
	Create(templateRequest TemplateRequest, ctx context.Context) (chart *TemplateRequest, err error)
	CreateChartFromEnvOverride(templateRequest TemplateRequest, ctx context.Context) (chart *TemplateRequest, err error)
	FindLatestChartForAppByAppId(appId int) (chartTemplate *TemplateRequest, err error)
	GetByAppIdAndChartRefId(appId int, chartRefId int) (chartTemplate *TemplateRequest, err error)
	UpdateAppOverride(ctx context.Context, templateRequest *TemplateRequest) (*TemplateRequest, error)
	IsReadyToTrigger(appId int, envId int, pipelineId int) (IsReady, error)
	FindPreviousChartByAppId(appId int) (chartTemplate *TemplateRequest, err error)
	UpgradeForApp(appId int, chartRefId int, newAppOverride map[string]interface{}, userId int32, ctx context.Context) (bool, error)
	CheckIfChartRefUserUploadedByAppId(id int) (bool, error)
	PatchEnvOverrides(values json.RawMessage, oldChartType string, newChartType string) (json.RawMessage, error)

	ChartRefAutocompleteForAppOrEnv(appId int, envId int) (*chartRefBean.ChartRefAutocompleteResponse, error)

	ConfigureGitOpsRepoUrlForApp(appId int, repoUrl, chartLocation string, isCustomRepo bool, userId int32) (*bean2.DeploymentConfig, error)

	IsGitOpsRepoConfiguredForDevtronApp(appId int) (bool, error)
	IsGitOpsRepoConfiguredForDevtronApps(appIds []int) (map[int]bool, error)
	IsGitOpsRepoAlreadyRegistered(gitOpsRepoUrl string) (bool, error)
}

type ChartServiceImpl

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

func NewChartServiceImpl

func NewChartServiceImpl(chartRepository chartRepoRepository.ChartRepository,
	logger *zap.SugaredLogger,
	chartTemplateService util.ChartTemplateService,
	repoRepository chartRepoRepository.ChartRepoRepository,
	pipelineGroupRepository app.AppRepository,
	mergeUtil util.MergeUtil,
	envOverrideRepository chartConfig.EnvConfigOverrideRepository,
	pipelineConfigRepository chartConfig.PipelineConfigRepository,
	environmentRepository repository4.EnvironmentRepository,
	deploymentTemplateHistoryService history.DeploymentTemplateHistoryService,
	scopedVariableManager variables.ScopedVariableManager,
	deployedAppMetricsService deployedAppMetrics.DeployedAppMetricsService,
	chartRefService chartRef.ChartRefService,
	gitOpsConfigReadService config.GitOpsConfigReadService,
	deploymentConfigService common.DeploymentConfigService) *ChartServiceImpl

func (*ChartServiceImpl) ChartRefAutocompleteForAppOrEnv

func (impl *ChartServiceImpl) ChartRefAutocompleteForAppOrEnv(appId int, envId int) (*chartRefBean.ChartRefAutocompleteResponse, error)

func (*ChartServiceImpl) CheckIfChartRefUserUploadedByAppId added in v0.6.29

func (impl *ChartServiceImpl) CheckIfChartRefUserUploadedByAppId(id int) (bool, error)

func (*ChartServiceImpl) ConfigureGitOpsRepoUrlForApp added in v0.7.2

func (impl *ChartServiceImpl) ConfigureGitOpsRepoUrlForApp(appId int, repoUrl, chartLocation string, isCustomRepo bool, userId int32) (*bean2.DeploymentConfig, error)

func (*ChartServiceImpl) Create

func (impl *ChartServiceImpl) Create(templateRequest TemplateRequest, ctx context.Context) (*TemplateRequest, error)

func (*ChartServiceImpl) CreateChartFromEnvOverride

func (impl *ChartServiceImpl) CreateChartFromEnvOverride(templateRequest TemplateRequest, ctx context.Context) (*TemplateRequest, error)

func (*ChartServiceImpl) FindLatestChartForAppByAppId

func (impl *ChartServiceImpl) FindLatestChartForAppByAppId(appId int) (chartTemplate *TemplateRequest, err error)

func (*ChartServiceImpl) FindPreviousChartByAppId

func (impl *ChartServiceImpl) FindPreviousChartByAppId(appId int) (chartTemplate *TemplateRequest, err error)

func (*ChartServiceImpl) GetByAppIdAndChartRefId

func (impl *ChartServiceImpl) GetByAppIdAndChartRefId(appId int, chartRefId int) (chartTemplate *TemplateRequest, err error)

func (*ChartServiceImpl) IsGitOpsRepoAlreadyRegistered added in v0.6.29

func (impl *ChartServiceImpl) IsGitOpsRepoAlreadyRegistered(gitOpsRepoUrl string) (bool, error)

func (*ChartServiceImpl) IsGitOpsRepoConfiguredForDevtronApp added in v0.7.2

func (impl *ChartServiceImpl) IsGitOpsRepoConfiguredForDevtronApp(appId int) (bool, error)

func (*ChartServiceImpl) IsGitOpsRepoConfiguredForDevtronApps added in v0.6.29

func (impl *ChartServiceImpl) IsGitOpsRepoConfiguredForDevtronApps(appIds []int) (map[int]bool, error)

func (*ChartServiceImpl) IsReadyToTrigger

func (impl *ChartServiceImpl) IsReadyToTrigger(appId int, envId int, pipelineId int) (IsReady, error)

func (*ChartServiceImpl) PatchEnvOverrides added in v0.6.21

func (impl *ChartServiceImpl) PatchEnvOverrides(values json.RawMessage, oldChartType string, newChartType string) (json.RawMessage, error)

func (*ChartServiceImpl) UpdateAppOverride

func (impl *ChartServiceImpl) UpdateAppOverride(ctx context.Context, templateRequest *TemplateRequest) (*TemplateRequest, error)

func (*ChartServiceImpl) UpgradeForApp

func (impl *ChartServiceImpl) UpgradeForApp(appId int, chartRefId int, newAppOverride map[string]interface{}, userId int32, ctx context.Context) (bool, error)

type ChartUpgradeRequest

type ChartUpgradeRequest struct {
	ChartRefId int   `json:"chartRefId"  validate:"number"`
	All        bool  `json:"all"`
	AppIds     []int `json:"appIds"`
	UserId     int32 `json:"-"`
}

type DefaultChart

type DefaultChart string

type IsReady

type IsReady struct {
	Flag    bool   `json:"flag"`
	Message string `json:"message"`
}

type PipelineConfigRequest

type PipelineConfigRequest struct {
	Id                   int             `json:"id"  validate:"number"`
	AppId                int             `json:"appId,omitempty"  validate:"number,required"`
	EnvConfigOverrideId  int             `json:"envConfigOverrideId,omitempty"`
	PipelineConfigValues json.RawMessage `json:"pipelineConfigValues,omitempty" validate:"required"` //json format user value
	PipelineId           int             `json:"PipelineId,omitempty"`
	Latest               bool            `json:"latest"`
	Previous             bool            `json:"previous"`
	EnvId                int             `json:"envId,omitempty"`
	ManualReviewed       bool            `json:"manualReviewed" validate:"required"`
	UserId               int32           `json:"-"`
}

type PipelineConfigRequestResponse

type PipelineConfigRequestResponse struct {
	LatestPipelineConfigRequest   PipelineConfigRequest `json:"latestPipelineConfigRequest"`
	PreviousPipelineConfigRequest PipelineConfigRequest `json:"previousPipelineConfigRequest"`
}

type ReservedChartList added in v0.6.23

type ReservedChartList struct {
	LocationPrefix string
	Name           string
}

type TemplateRequest

type TemplateRequest struct {
	Id                      int                         `json:"id"  validate:"number"`
	AppId                   int                         `json:"appId,omitempty"  validate:"number,required"`
	RefChartTemplate        string                      `json:"refChartTemplate,omitempty"`
	RefChartTemplateVersion string                      `json:"refChartTemplateVersion,omitempty"`
	ChartRepositoryId       int                         `json:"chartRepositoryId,omitempty"`
	ValuesOverride          json.RawMessage             `json:"valuesOverride,omitempty" validate:"required"` //json format user value
	DefaultAppOverride      json.RawMessage             `json:"defaultAppOverride,omitempty"`                 //override values available
	ChartRefId              int                         `json:"chartRefId,omitempty"  validate:"number"`
	Latest                  bool                        `json:"latest"`
	IsAppMetricsEnabled     bool                        `json:"isAppMetricsEnabled"`
	Schema                  json.RawMessage             `json:"schema"`
	Readme                  string                      `json:"readme"`
	IsBasicViewLocked       bool                        `json:"isBasicViewLocked"`
	CurrentViewEditor       models.ChartsViewEditorType `json:"currentViewEditor"` //default "UNDEFINED" in db
	GitRepoUrl              string                      `json:"-"`
	IsCustomGitRepository   bool                        `json:"-"`
	UserId                  int32                       `json:"-"`
	LatestChartVersion      string                      `json:"-"`
	ImageDescriptorTemplate string                      `json:"-"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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