Documentation ¶
Index ¶
- Constants
- func CompareUnOrdered(a, b []int) bool
- func CreateEcrRepo(repoName string, reg string, accessKey string, secretKey string) error
- func GetClientDetailedError(err error) (*errors.ClientStatusCode, string)
- func GetClientErrorDetailedMessage(err error) string
- func GetLogger() *zap.SugaredLoggerdeprecated
- func GetTruncatedMessage(message string, maxLength int) string
- func InitLogger() (*zap.SugaredLogger, error)
- func IntValidator() (*validator.Validate, error)
- func IsAcdApp(deploymentAppType string) bool
- func IsErrNoRows(err error) bool
- func IsErrorContextCancelled(err error) bool
- func IsErrorContextCancelledOrDeadlineExceeded(err error) (int, bool)
- func IsErrorContextDeadlineExceeded(err error) bool
- func IsHelmApp(deploymentAppType string) bool
- func IsManifestDownload(deploymentAppType string) bool
- func IsManifestPush(deploymentAppType string) bool
- func IsOCIConfigChartProvider(ociRegistryConfig *dockerRegistryRepository.OCIRegistryConfig) bool
- func IsOCIRegistryChartProvider(ociRegistry dockerRegistryRepository.DockerArtifactStore) bool
- func NewHttpClient() *http.Client
- func NewSugardLogger() (*zap.SugaredLogger, error)
- func TopoSort(graph map[int][]int) []int
- func ValidateCheckoutPath(fl validator.FieldLevel) bool
- func ValidateName(fl validator.FieldLevel) bool
- func ValidateNameSpace(fl validator.FieldLevel) bool
- type ApiError
- func (e *ApiError) Error() string
- func (e *ApiError) ErrorfInternal(format string, a ...interface{}) error
- func (e *ApiError) ErrorfUser(format string, a ...interface{}) error
- func (e *ApiError) WithCode(code string) *ApiError
- func (e *ApiError) WithHttpStatusCode(httpStatusCode int) *ApiError
- func (e *ApiError) WithInternalMessage(InternalMessage string) *ApiError
- func (e *ApiError) WithUserDetailMessage(UserDetailMessage string) *ApiError
- func (e *ApiError) WithUserMessage(userMessage interface{}) *ApiError
- type BadRequestError
- type ChartCreateRequest
- type ChartCreateResponse
- type ChartTemplateService
- type ChartTemplateServiceImpl
- func (impl ChartTemplateServiceImpl) BuildChart(ctx context.Context, chartMetaData *chart.Metadata, ...) (string, error)
- func (impl ChartTemplateServiceImpl) BuildChartProxyForHelmApps(chartCreateRequest *ChartCreateRequest) (*ChartCreateResponse, error)
- func (impl ChartTemplateServiceImpl) CleanDir(dir string)
- func (impl ChartTemplateServiceImpl) CreateZipFileForChart(chart *chart.Chart, outputChartPathDir string) ([]byte, error)
- func (impl ChartTemplateServiceImpl) FetchValuesFromReferenceChart(chartMetaData *chart.Metadata, refChartLocation string, templateName string, ...) (*ChartValues, error)
- func (impl ChartTemplateServiceImpl) GetByteArrayRefChart(chartMetaData *chart.Metadata, referenceTemplatePath string) ([]byte, error)
- func (impl ChartTemplateServiceImpl) GetChartVersion(location string) (string, error)
- func (impl ChartTemplateServiceImpl) GetDir() string
- func (impl ChartTemplateServiceImpl) LoadChartFromDir(dir string) (*chart.Chart, error)
- func (impl ChartTemplateServiceImpl) LoadChartInBytes(ChartPath string, deleteChart bool) ([]byte, error)
- func (impl ChartTemplateServiceImpl) PackageChart(tempReferenceTemplateDir string, chartMetaData *chart.Metadata) (*string, string, error)
- type ChartValues
- type ForbiddenError
- type InternalServerError
- type LogConfig
- type MergeUtil
- func (m MergeUtil) ConfigMapMerge(appLevelConfigMapJson string, envLevelConfigMapJson string) (data string, err error)
- func (m MergeUtil) ConfigSecretMerge(appLevelSecretJson string, envLevelSecretJson string, chartMajorVersion int, ...) (data string, err error)
- func (m MergeUtil) JsonPatch(target, patch []byte) (data []byte, err error)
Constants ¶
View Source
const ( PIPELINE_DEPLOYMENT_TYPE_ACD = "argo_cd" PIPELINE_DEPLOYMENT_TYPE_HELM = "helm" PIPELINE_DEPLOYMENT_TYPE_MANIFEST_DOWNLOAD = "manifest_download" PIPELINE_DEPLOYMENT_TYPE_MANIFEST_PUSH = "manifest_push" CHART_WORKING_DIR_PATH = "/tmp/charts/" )
View Source
const (
PIPELINE_RELEASE_MODE_CREATE = "create"
)
Variables ¶
This section is empty.
Functions ¶
func CompareUnOrdered ¶
func CreateEcrRepo ¶
FIXME: this code is temp
func GetClientDetailedError ¶ added in v0.7.0
func GetClientDetailedError(err error) (*errors.ClientStatusCode, string)
func GetClientErrorDetailedMessage ¶ added in v0.7.0
func GetLogger
deprecated
func GetLogger() *zap.SugaredLogger
Deprecated: instead calling this method inject logger from wire
func GetTruncatedMessage ¶ added in v0.6.26
func InitLogger ¶ added in v0.4.1
func InitLogger() (*zap.SugaredLogger, error)
func IntValidator ¶
func IntValidator() (*validator.Validate, error)
func IsErrNoRows ¶
func IsErrorContextCancelled ¶ added in v0.7.1
func IsErrorContextCancelledOrDeadlineExceeded ¶ added in v0.7.0
func IsErrorContextDeadlineExceeded ¶ added in v0.7.1
func IsManifestDownload ¶ added in v0.6.17
TODO refactoring: This feature belongs to enterprise only
func IsManifestPush ¶ added in v0.7.0
func IsOCIConfigChartProvider ¶ added in v0.6.23
func IsOCIConfigChartProvider(ociRegistryConfig *dockerRegistryRepository.OCIRegistryConfig) bool
func IsOCIRegistryChartProvider ¶ added in v0.6.23
func IsOCIRegistryChartProvider(ociRegistry dockerRegistryRepository.DockerArtifactStore) bool
func NewHttpClient ¶
func NewSugardLogger ¶
func NewSugardLogger() (*zap.SugaredLogger, error)
func ValidateCheckoutPath ¶
func ValidateCheckoutPath(fl validator.FieldLevel) bool
func ValidateName ¶
func ValidateName(fl validator.FieldLevel) bool
func ValidateNameSpace ¶ added in v0.6.0
func ValidateNameSpace(fl validator.FieldLevel) bool
Types ¶
type ApiError ¶
type ApiError struct { HttpStatusCode int `json:"-"` Code string `json:"code,omitempty"` InternalMessage string `json:"internalMessage,omitempty"` UserMessage interface{} `json:"userMessage,omitempty"` UserDetailMessage string `json:"userDetailMessage,omitempty"` }
func DefaultApiError ¶ added in v1.1.0
func DefaultApiError() *ApiError
func NewApiError ¶ added in v0.7.0
func (*ApiError) ErrorfInternal ¶
default internal will be set
func (*ApiError) ErrorfUser ¶
default user message will be set
func (*ApiError) WithHttpStatusCode ¶ added in v0.7.0
func (*ApiError) WithInternalMessage ¶ added in v0.7.0
func (*ApiError) WithUserDetailMessage ¶ added in v0.7.0
func (*ApiError) WithUserMessage ¶ added in v0.7.0
type BadRequestError ¶ added in v0.3.6
type BadRequestError struct {
E error
}
func (*BadRequestError) Error ¶ added in v0.3.6
func (err *BadRequestError) Error() string
type ChartCreateRequest ¶ added in v0.6.17
type ChartCreateResponse ¶ added in v0.6.17
type ChartCreateResponse struct { BuiltChartPath string // contains filtered or unexported fields }
type ChartTemplateService ¶
type ChartTemplateService interface { FetchValuesFromReferenceChart(chartMetaData *chart.Metadata, refChartLocation string, templateName string, userId int32, pipelineStrategyPath string) (*ChartValues, error) GetChartVersion(location string) (string, error) BuildChart(ctx context.Context, chartMetaData *chart.Metadata, referenceTemplatePath string) (string, error) BuildChartProxyForHelmApps(chartCreateRequest *ChartCreateRequest) (chartCreateResponse *ChartCreateResponse, err error) GetDir() string CleanDir(dir string) GetByteArrayRefChart(chartMetaData *chart.Metadata, referenceTemplatePath string) ([]byte, error) LoadChartInBytes(ChartPath string, deleteChart bool) ([]byte, error) LoadChartFromDir(dir string) (*chart.Chart, error) CreateZipFileForChart(chart *chart.Chart, outputChartPathDir string) ([]byte, error) PackageChart(tempReferenceTemplateDir string, chartMetaData *chart.Metadata) (*string, string, error) }
type ChartTemplateServiceImpl ¶
type ChartTemplateServiceImpl struct {
// contains filtered or unexported fields
}
func NewChartTemplateServiceImpl ¶
func NewChartTemplateServiceImpl(logger *zap.SugaredLogger) *ChartTemplateServiceImpl
func (ChartTemplateServiceImpl) BuildChart ¶ added in v0.6.12
func (impl ChartTemplateServiceImpl) BuildChart(ctx context.Context, chartMetaData *chart.Metadata, referenceTemplatePath string) (string, error)
TODO: convert BuildChart and BuildChartProxyForHelmApps into one function
func (ChartTemplateServiceImpl) BuildChartProxyForHelmApps ¶ added in v0.6.17
func (impl ChartTemplateServiceImpl) BuildChartProxyForHelmApps(chartCreateRequest *ChartCreateRequest) (*ChartCreateResponse, error)
func (ChartTemplateServiceImpl) CleanDir ¶
func (impl ChartTemplateServiceImpl) CleanDir(dir string)
func (ChartTemplateServiceImpl) CreateZipFileForChart ¶ added in v0.6.24
func (ChartTemplateServiceImpl) FetchValuesFromReferenceChart ¶ added in v0.4.5
func (impl ChartTemplateServiceImpl) FetchValuesFromReferenceChart(chartMetaData *chart.Metadata, refChartLocation string, templateName string, userId int32, pipelineStrategyPath string) (*ChartValues, error)
func (ChartTemplateServiceImpl) GetByteArrayRefChart ¶ added in v0.4.14
func (impl ChartTemplateServiceImpl) GetByteArrayRefChart(chartMetaData *chart.Metadata, referenceTemplatePath string) ([]byte, error)
GetByteArrayRefChart this method will be used for getting byte array from reference chart to store in db
func (ChartTemplateServiceImpl) GetChartVersion ¶
func (impl ChartTemplateServiceImpl) GetChartVersion(location string) (string, error)
func (ChartTemplateServiceImpl) GetDir ¶ added in v0.3.22
func (impl ChartTemplateServiceImpl) GetDir() string
func (ChartTemplateServiceImpl) LoadChartFromDir ¶ added in v0.6.24
func (impl ChartTemplateServiceImpl) LoadChartFromDir(dir string) (*chart.Chart, error)
func (ChartTemplateServiceImpl) LoadChartInBytes ¶ added in v0.6.17
func (impl ChartTemplateServiceImpl) LoadChartInBytes(ChartPath string, deleteChart bool) ([]byte, error)
func (ChartTemplateServiceImpl) PackageChart ¶ added in v0.6.29
type ChartValues ¶
type ChartValues struct { Values string `json:"values"` //yaml AppOverrides string `json:"appOverrides"` //json EnvOverrides string `json:"envOverrides"` //json ReleaseOverrides string `json:"releaseOverrides"` //json PipelineOverrides string `json:"pipelineOverrides"` //json ImageDescriptorTemplate string `json:"-"` }
type ForbiddenError ¶ added in v0.3.6
type ForbiddenError struct {
E error
}
func (*ForbiddenError) Error ¶ added in v0.3.6
func (err *ForbiddenError) Error() string
type InternalServerError ¶ added in v0.3.6
type InternalServerError struct {
E error
}
func (*InternalServerError) Error ¶ added in v0.3.6
func (err *InternalServerError) Error() string
type MergeUtil ¶
type MergeUtil struct {
Logger *zap.SugaredLogger
}
func (MergeUtil) ConfigMapMerge ¶
func (MergeUtil) ConfigSecretMerge ¶
func (MergeUtil) JsonPatch ¶
//returns json representation of merged values
func (m MergeUtil) MergeOverride(helmValues string, override []byte) ([]byte, error) { cf, err := conflate.FromData([]byte(helmValues), override) if err != nil { m.Logger.Errorw("error in merging config", "original", helmValues, "override", override, "error", err) return nil, err } jsonBytes, err := cf.MarshalJSON() if err != nil { m.Logger.Errorw("error in marshaling yaml ", "cf", cf, "error", err) return nil, err } dst := new(bytes.Buffer) err = json.Compact(dst, jsonBytes) if err != nil { return nil, err } jsonBytes = dst.Bytes() m.Logger.Infow("merged config ", "original", helmValues, "override", override, "yaml", jsonBytes, ) return jsonBytes, nil }
func (m MergeUtil) MergeOverrideVal(data ...[]byte) ([]byte, error) { cf, err := conflate.FromData(data...) if err != nil { m.Logger.Errorw("error in merging config", "val", data, "error", err) return nil, err } jsonBytes, err := cf.MarshalJSON() if err != nil { m.Logger.Errorw("error in marshaling yaml ", "cf", cf, "error", err) return nil, err } dst := new(bytes.Buffer) err = json.Compact(dst, jsonBytes) if err != nil { return nil, err } jsonBytes = dst.Bytes() return jsonBytes, nil }
merges two json objects
Source Files ¶
Click to show internal directories.
Click to hide internal directories.