diff --git a/k8s-deploy/pkg/modules/helm_chart.go b/k8s-deploy/pkg/modules/helm_chart.go index 037f478d6..57c75b91c 100644 --- a/k8s-deploy/pkg/modules/helm_chart.go +++ b/k8s-deploy/pkg/modules/helm_chart.go @@ -26,14 +26,15 @@ import ( // HelmChart Helm Chart model type HelmChart struct { - Uuid string `json:"uuid" gorm:"type:varchar(36);index;unique"` - Name string `json:"name" gorm:"type:varchar(16);not null"` - Chart string `json:"chart" gorm:"type:text;not null"` - Values string `json:"values" gorm:"type:text;not null"` - ValuesTemplate string `json:"values_template" gorm:"type:text;not null"` - Templates Templates `json:"templates" gorm:"type:mediumblob" swaggerignore:"true"` - Version string `json:"version" gorm:"type:varchar(32);not null"` - AppVersion string `json:"app_version" gorm:"type:varchar(32);not null"` + Uuid string `json:"uuid" gorm:"type:varchar(36);index;unique"` + Name string `json:"name" gorm:"type:varchar(16);not null"` + Chart string `json:"chart" gorm:"type:text;not null"` + Values string `json:"values" gorm:"type:text;not null"` + ValuesTemplate string `json:"values_template" gorm:"type:text;not null"` + ValuesTemplateExample string `json:"values_template_example" gorm:"type:text;not null"` + Templates Templates `json:"templates" gorm:"type:mediumblob" swaggerignore:"true"` + Version string `json:"version" gorm:"type:varchar(32);not null"` + AppVersion string `json:"app_version" gorm:"type:varchar(32);not null"` gorm.Model } diff --git a/k8s-deploy/pkg/modules/helm_chart_special.go b/k8s-deploy/pkg/modules/helm_chart_special.go index 7af5166c2..4888bd451 100644 --- a/k8s-deploy/pkg/modules/helm_chart_special.go +++ b/k8s-deploy/pkg/modules/helm_chart_special.go @@ -39,6 +39,7 @@ func (e *HelmChart) ChartRequestedToHelmChart(chartRequested *chart.Chart) (*Hel var chartData string var valuesData string var ValuesTemplate string + var ValuesTemplateExample string for _, v := range chartRequested.Raw { if v.Name == "Chart.yaml" { chartData = string(v.Data) @@ -49,12 +50,16 @@ func (e *HelmChart) ChartRequestedToHelmChart(chartRequested *chart.Chart) (*Hel if v.Name == "values-template.yaml" { ValuesTemplate = string(v.Data) } + if v.Name == "values-template-example.yaml" { + ValuesTemplateExample = string(v.Data) + } } helmChart := NewHelmChart(chartRequested.Name(), chartData, valuesData, chartRequested.Templates, chartRequested.Metadata.Version, chartRequested.AppVersion()) helmChart.ValuesTemplate = ValuesTemplate + helmChart.ValuesTemplateExample = ValuesTemplateExample return helmChart, nil } @@ -103,6 +108,7 @@ func ChartRequestedToHelmChart(chartRequested *chart.Chart) (*HelmChart, error) var chartData string var valuesData string var ValuesTemplate string + var ValuesTemplateExample string for _, v := range chartRequested.Raw { if v.Name == "Chart.yaml" { chartData = string(v.Data) @@ -113,12 +119,16 @@ func ChartRequestedToHelmChart(chartRequested *chart.Chart) (*HelmChart, error) if v.Name == "values-template.yaml" { ValuesTemplate = string(v.Data) } + if v.Name == "values-template-example.yaml" { + ValuesTemplateExample = string(v.Data) + } } helmChart := NewHelmChart(chartRequested.Name(), chartData, valuesData, chartRequested.Templates, chartRequested.Metadata.Version, chartRequested.AppVersion()) helmChart.ValuesTemplate = ValuesTemplate + helmChart.ValuesTemplateExample = ValuesTemplateExample return helmChart, nil }