-
Notifications
You must be signed in to change notification settings - Fork 198
/
werf_subchart.go
62 lines (49 loc) · 1.74 KB
/
werf_subchart.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package chart_extender
import (
"text/template"
"helm.sh/helm/v3/pkg/chart"
"helm.sh/helm/v3/pkg/chartutil"
"helm.sh/helm/v3/pkg/cli"
)
// NOTE: maybe in the future we will need a support for the werf project to be used as a chart.
// NOTE: This extender allows to define this behaviour.
func NewWerfSubchart() *WerfSubchart {
return &WerfSubchart{}
}
type WerfSubchart struct {
HelmChart *chart.Chart
}
// ChartCreated method for the chart.Extender interface
func (wc *WerfSubchart) ChartCreated(c *chart.Chart) error {
wc.HelmChart = c
return nil
}
// ChartLoaded method for the chart.Extender interface
func (wc *WerfSubchart) ChartLoaded(files []*chart.ChartExtenderBufferedFile) error {
return nil
}
// ChartDependenciesLoaded method for the chart.Extender interface
func (wc *WerfSubchart) ChartDependenciesLoaded() error {
return nil
}
// MakeValues method for the chart.Extender interface
func (wc *WerfSubchart) MakeValues(inputVals map[string]interface{}) (map[string]interface{}, error) {
vals := make(map[string]interface{})
chartutil.CoalesceTables(vals, inputVals)
return vals, nil
}
// SetupTemplateFuncs method for the chart.Extender interface
func (wc *WerfSubchart) SetupTemplateFuncs(t *template.Template, funcMap template.FuncMap) {
}
// LoadDir method for the chart.Extender interface
func (wc *WerfSubchart) LoadDir(dir string) (bool, []*chart.ChartExtenderBufferedFile, error) {
return false, nil, nil
}
// LocateChart method for the chart.Extender interface
func (wc *WerfSubchart) LocateChart(name string, settings *cli.EnvSettings) (bool, string, error) {
return false, "", nil
}
// ReadFile method for the chart.Extender interface
func (wc *WerfSubchart) ReadFile(filePath string) (bool, []byte, error) {
return false, nil, nil
}