Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - Variables
 - func CheckCompatibility(oldChartType, newChartType string) bool
 - func CompatibleChartsWith(chartType string) []string
 - func PatchWinterSoldierConfig(override json.RawMessage, newChartType string) (json.RawMessage, error)
 - func PatchWinterSoldierIfExists(newChartType string, jsonMap map[string]json.RawMessage) (map[string]json.RawMessage, error)
 - func SetReservedChartList(devtronChartList []*chartRepoRepository.ChartRef)
 - type AppConfigResponse
 - type AppMetricEnableDisableRequest
 - type AppMetricsEnabled
 - type ChartDataInfo
 - type ChartDto
 - type ChartRef
 - type ChartRefChangeRequest
 - type ChartRefMetaData
 - type ChartRefResponse
 - type ChartService
 - type ChartServiceImpl
 - func (impl ChartServiceImpl) AppMetricsEnableDisable(appMetricRequest AppMetricEnableDisableRequest) (*AppMetricEnableDisableRequest, error)
 - func (impl ChartServiceImpl) ChartRefAutocomplete() ([]ChartRef, error)
 - func (impl ChartServiceImpl) ChartRefAutocompleteForAppOrEnv(appId int, envId int) (*ChartRefResponse, error)
 - func (impl ChartServiceImpl) ChartRefIdsCompatible(oldChartRefId int, newChartRefId int) (bool, string, string)
 - func (impl ChartServiceImpl) CheckChartExists(chartRefId int) error
 - func (impl ChartServiceImpl) CheckCustomChartByAppId(id int) (bool, error)
 - func (impl ChartServiceImpl) CheckCustomChartByChartId(id int) (bool, error)
 - func (impl ChartServiceImpl) CheckIsAppMetricsSupported(chartRefId int) (bool, error)
 - func (impl ChartServiceImpl) Create(templateRequest TemplateRequest, ctx context.Context) (*TemplateRequest, error)
 - func (impl ChartServiceImpl) CreateChartFromEnvOverride(templateRequest TemplateRequest, ctx context.Context) (*TemplateRequest, error)
 - func (impl ChartServiceImpl) DeploymentTemplateValidate(ctx context.Context, template interface{}, chartRefId int, ...) (bool, error)
 - func (impl ChartServiceImpl) ExtractChartIfMissing(chartData []byte, refChartDir string, location string) (*ChartDataInfo, error)
 - func (impl ChartServiceImpl) ExtractVariablesAndResolveTemplate(scope resourceQualifiers.Scope, template string, ...) (string, map[string]string, error)
 - func (impl ChartServiceImpl) FetchCustomChartsInfo() ([]*ChartDto, error)
 - func (impl ChartServiceImpl) FindLatestChartForAppByAppId(appId int) (chartTemplate *TemplateRequest, err error)
 - func (impl ChartServiceImpl) FindPreviousChartByAppId(appId int) (chartTemplate *TemplateRequest, err error)
 - func (impl ChartServiceImpl) FlaggerCanaryEnabled(values json.RawMessage) (bool, error)
 - func (impl *ChartServiceImpl) FormatChartName(chartName string) string
 - func (impl ChartServiceImpl) GetAppOverrideForDefaultTemplate(chartRefId int) (map[string]interface{}, string, error)
 - func (impl ChartServiceImpl) GetByAppIdAndChartRefId(appId int, chartRefId int) (chartTemplate *TemplateRequest, err error)
 - func (impl ChartServiceImpl) GetCustomChartInBytes(chartRefId int) ([]byte, error)
 - func (impl *ChartServiceImpl) GetLocationFromChartNameAndVersion(chartName string, chartVersion string) string
 - func (impl ChartServiceImpl) GetRefChart(templateRequest TemplateRequest) (string, string, error, string, string)
 - func (impl ChartServiceImpl) GetSchemaAndReadmeForTemplateByChartRefId(chartRefId int) ([]byte, []byte, error)
 - func (impl ChartServiceImpl) IsReadyToTrigger(appId int, envId int, pipelineId int) (IsReady, error)
 - func (impl ChartServiceImpl) JsonSchemaExtractFromFile(chartRefId int) (map[string]interface{}, string, error)
 - func (impl ChartServiceImpl) PatchEnvOverrides(values json.RawMessage, oldChartType string, newChartType string) (json.RawMessage, error)
 - func (impl ChartServiceImpl) ReadChartMetaDataForLocation(chartDir string, fileName string) (*ChartYamlStruct, error)
 - func (impl ChartServiceImpl) RegisterInArgo(chartGitAttribute *util.ChartGitAttribute, ctx context.Context) error
 - func (impl ChartServiceImpl) UpdateAppOverride(ctx context.Context, templateRequest *TemplateRequest) (*TemplateRequest, error)
 - func (impl ChartServiceImpl) UpgradeForApp(appId int, chartRefId int, newAppOverride map[string]interface{}, userId int32, ...) (bool, error)
 - func (impl ChartServiceImpl) ValidateReservedChartName(chartName string) (isReservedChart bool, err error)
 - func (impl *ChartServiceImpl) ValidateUploadedFileFormat(fileName string) error
 
- type ChartUpgradeRequest
 - type ChartYamlStruct
 - type DefaultChart
 - type IsReady
 - type PipelineConfigRequest
 - type PipelineConfigRequestResponse
 - type ReservedChartList
 - type TemplateRequest
 
Constants ¶
      View Source
      
  
    const ( DeploymentChartType = "Deployment" RolloutChartType = "Rollout Deployment" ReferenceChart = "reference-chart" )
      View Source
      
  
const ( CHART_ALREADY_EXISTS_INTERNAL_ERROR = "Chart exists already, try uploading another chart" CHART_NAME_RESERVED_INTERNAL_ERROR = "Change the name of the chart and try uploading again" )
Variables ¶
      View Source
      
  
var ReservedChartRefNamesList *[]ReservedChartList
    Functions ¶
func CheckCompatibility ¶ added in v0.6.21
func CompatibleChartsWith ¶ added in v0.6.21
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)
func SetReservedChartList ¶ added in v0.6.23
func SetReservedChartList(devtronChartList []*chartRepoRepository.ChartRef)
Types ¶
type AppConfigResponse ¶
type AppConfigResponse struct {
	//DefaultAppConfig  json.RawMessage `json:"defaultAppConfig"`
	//AppConfig         TemplateRequest            `json:"appConfig"`
	LatestAppConfig   TemplateRequest `json:"latestAppConfig"`
	PreviousAppConfig TemplateRequest `json:"previousAppConfig"`
}
    type AppMetricsEnabled ¶
type AppMetricsEnabled struct {
	AppMetrics bool `json:"app-metrics"`
}
    type ChartDataInfo ¶
type ChartRefChangeRequest ¶ added in v0.6.21
type ChartRefMetaData ¶ added in v0.6.6
type ChartRefMetaData struct {
	ChartDescription string `json:"chartDescription"`
}
    type ChartRefResponse ¶ added in v0.6.22
type ChartRefResponse struct {
	ChartRefs            []ChartRef                  `json:"chartRefs"`
	LatestChartRef       int                         `json:"latestChartRef"`
	LatestAppChartRef    int                         `json:"latestAppChartRef"`
	LatestEnvChartRef    int                         `json:"latestEnvChartRef,omitempty"`
	ChartsMetadata       map[string]ChartRefMetaData `json:"chartMetadata"` // chartName vs Metadata
	CompatibleChartTypes []string                    `json:"compatibleChartTypes,omitempty"`
}
    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)
	GetAppOverrideForDefaultTemplate(chartRefId int) (map[string]interface{}, string, error)
	UpdateAppOverride(ctx context.Context, templateRequest *TemplateRequest) (*TemplateRequest, error)
	IsReadyToTrigger(appId int, envId int, pipelineId int) (IsReady, error)
	ChartRefAutocomplete() ([]ChartRef, error)
	ChartRefAutocompleteForAppOrEnv(appId int, envId int) (*ChartRefResponse, error)
	FindPreviousChartByAppId(appId int) (chartTemplate *TemplateRequest, err error)
	UpgradeForApp(appId int, chartRefId int, newAppOverride map[string]interface{}, userId int32, ctx context.Context) (bool, error)
	AppMetricsEnableDisable(appMetricRequest AppMetricEnableDisableRequest) (*AppMetricEnableDisableRequest, error)
	DeploymentTemplateValidate(ctx context.Context, templatejson interface{}, chartRefId int, scope resourceQualifiers.Scope) (bool, error)
	JsonSchemaExtractFromFile(chartRefId int) (map[string]interface{}, string, error)
	GetSchemaAndReadmeForTemplateByChartRefId(chartRefId int) (schema []byte, readme []byte, err error)
	ExtractChartIfMissing(chartData []byte, refChartDir string, location string) (*ChartDataInfo, error)
	CheckChartExists(chartRefId int) error
	CheckIsAppMetricsSupported(chartRefId int) (bool, error)
	GetLocationFromChartNameAndVersion(chartName string, chartVersion string) string
	FormatChartName(chartName string) string
	ValidateUploadedFileFormat(fileName string) error
	ReadChartMetaDataForLocation(chartDir string, fileName string) (*ChartYamlStruct, error)
	RegisterInArgo(chartGitAttribute *util.ChartGitAttribute, ctx context.Context) error
	FetchCustomChartsInfo() ([]*ChartDto, error)
	CheckCustomChartByAppId(id int) (bool, error)
	CheckCustomChartByChartId(id int) (bool, error)
	ChartRefIdsCompatible(oldChartRefId int, newChartRefId int) (bool, string, string)
	PatchEnvOverrides(values json.RawMessage, oldChartType string, newChartType string) (json.RawMessage, error)
	FlaggerCanaryEnabled(values json.RawMessage) (bool, error)
	GetCustomChartInBytes(chatRefId int) ([]byte, error)
	GetRefChart(templateRequest TemplateRequest) (string, string, error, string, string)
	ExtractVariablesAndResolveTemplate(scope resourceQualifiers.Scope, template string, templateType parsers.VariableTemplateType, isSuperAdmin bool, maskUnknownVariable bool) (string, map[string]string, 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, refChartDir chartRepoRepository.RefChartDir, defaultChart DefaultChart, mergeUtil util.MergeUtil, repositoryService repository.ServiceClient, chartRefRepository chartRepoRepository.ChartRefRepository, envOverrideRepository chartConfig.EnvConfigOverrideRepository, pipelineConfigRepository chartConfig.PipelineConfigRepository, configMapRepository chartConfig.ConfigMapRepository, environmentRepository repository4.EnvironmentRepository, pipelineRepository pipelineConfig.PipelineRepository, appLevelMetricsRepository repository3.AppLevelMetricsRepository, envLevelAppMetricsRepository repository3.EnvLevelAppMetricsRepository, client *http.Client, deploymentTemplateHistoryService history.DeploymentTemplateHistoryService, variableEntityMappingService variables.VariableEntityMappingService, variableTemplateParser parsers.VariableTemplateParser, scopedVariableService variables.ScopedVariableService) *ChartServiceImpl
func (ChartServiceImpl) AppMetricsEnableDisable ¶
func (impl ChartServiceImpl) AppMetricsEnableDisable(appMetricRequest AppMetricEnableDisableRequest) (*AppMetricEnableDisableRequest, error)
func (ChartServiceImpl) ChartRefAutocomplete ¶
func (impl ChartServiceImpl) ChartRefAutocomplete() ([]ChartRef, error)
func (ChartServiceImpl) ChartRefAutocompleteForAppOrEnv ¶
func (impl ChartServiceImpl) ChartRefAutocompleteForAppOrEnv(appId int, envId int) (*ChartRefResponse, error)
func (ChartServiceImpl) ChartRefIdsCompatible ¶ added in v0.6.21
func (ChartServiceImpl) CheckChartExists ¶
func (impl ChartServiceImpl) CheckChartExists(chartRefId int) error
func (ChartServiceImpl) CheckCustomChartByAppId ¶
func (impl ChartServiceImpl) CheckCustomChartByAppId(id int) (bool, error)
func (ChartServiceImpl) CheckCustomChartByChartId ¶
func (impl ChartServiceImpl) CheckCustomChartByChartId(id int) (bool, error)
func (ChartServiceImpl) CheckIsAppMetricsSupported ¶ added in v0.6.17
func (impl ChartServiceImpl) CheckIsAppMetricsSupported(chartRefId int) (bool, 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) DeploymentTemplateValidate ¶
func (impl ChartServiceImpl) DeploymentTemplateValidate(ctx context.Context, template interface{}, chartRefId int, scope resourceQualifiers.Scope) (bool, error)
func (ChartServiceImpl) ExtractChartIfMissing ¶
func (impl ChartServiceImpl) ExtractChartIfMissing(chartData []byte, refChartDir string, location string) (*ChartDataInfo, error)
func (ChartServiceImpl) ExtractVariablesAndResolveTemplate ¶ added in v0.6.24
func (impl ChartServiceImpl) ExtractVariablesAndResolveTemplate(scope resourceQualifiers.Scope, template string, templateType parsers.VariableTemplateType, isSuperAdmin bool, maskUnknownVariable bool) (string, map[string]string, error)
func (ChartServiceImpl) FetchCustomChartsInfo ¶ added in v0.6.23
func (impl ChartServiceImpl) FetchCustomChartsInfo() ([]*ChartDto, 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) FlaggerCanaryEnabled ¶ added in v0.6.21
func (impl ChartServiceImpl) FlaggerCanaryEnabled(values json.RawMessage) (bool, error)
func (*ChartServiceImpl) FormatChartName ¶ added in v0.6.23
func (impl *ChartServiceImpl) FormatChartName(chartName string) string
func (ChartServiceImpl) GetAppOverrideForDefaultTemplate ¶
func (impl ChartServiceImpl) GetAppOverrideForDefaultTemplate(chartRefId int) (map[string]interface{}, string, error)
func (ChartServiceImpl) GetByAppIdAndChartRefId ¶
func (impl ChartServiceImpl) GetByAppIdAndChartRefId(appId int, chartRefId int) (chartTemplate *TemplateRequest, err error)
func (ChartServiceImpl) GetCustomChartInBytes ¶ added in v0.6.23
func (impl ChartServiceImpl) GetCustomChartInBytes(chartRefId int) ([]byte, error)
func (*ChartServiceImpl) GetLocationFromChartNameAndVersion ¶
func (impl *ChartServiceImpl) GetLocationFromChartNameAndVersion(chartName string, chartVersion string) string
func (ChartServiceImpl) GetRefChart ¶ added in v0.6.24
func (impl ChartServiceImpl) GetRefChart(templateRequest TemplateRequest) (string, string, error, string, string)
func (ChartServiceImpl) GetSchemaAndReadmeForTemplateByChartRefId ¶
func (impl ChartServiceImpl) GetSchemaAndReadmeForTemplateByChartRefId(chartRefId int) ([]byte, []byte, error)
func (ChartServiceImpl) IsReadyToTrigger ¶
func (ChartServiceImpl) JsonSchemaExtractFromFile ¶
func (impl ChartServiceImpl) JsonSchemaExtractFromFile(chartRefId int) (map[string]interface{}, string, 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) ReadChartMetaDataForLocation ¶
func (impl ChartServiceImpl) ReadChartMetaDataForLocation(chartDir string, fileName string) (*ChartYamlStruct, error)
func (ChartServiceImpl) RegisterInArgo ¶
func (impl ChartServiceImpl) RegisterInArgo(chartGitAttribute *util.ChartGitAttribute, ctx context.Context) error
func (ChartServiceImpl) UpdateAppOverride ¶
func (impl ChartServiceImpl) UpdateAppOverride(ctx context.Context, templateRequest *TemplateRequest) (*TemplateRequest, error)
func (ChartServiceImpl) UpgradeForApp ¶
func (ChartServiceImpl) ValidateReservedChartName ¶ added in v0.6.23
func (impl ChartServiceImpl) ValidateReservedChartName(chartName string) (isReservedChart bool, err error)
func (*ChartServiceImpl) ValidateUploadedFileFormat ¶
func (impl *ChartServiceImpl) ValidateUploadedFileFormat(fileName string) error
type ChartUpgradeRequest ¶
type ChartYamlStruct ¶
type DefaultChart ¶
type DefaultChart string
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 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
	UserId                  int32                       `json:"-"`
}
     Click to show internal directories. 
   Click to hide internal directories.