MCPcopy
hub / github.com/cyclops-ui/cyclops / LoadHelmChartInitialValues

Method LoadHelmChartInitialValues

cyclops-ctrl/pkg/template/helm.go:66–99  ·  view source on GitHub ↗
(repo, chart, version string)

Source from the content-addressed store, hash-verified

64}
65
66func (r Repo) LoadHelmChartInitialValues(repo, chart, version string) (map[string]interface{}, error) {
67 var err error
68 strictVersion := version
69 if !isValidVersion(version) {
70 strictVersion, err = getRepoStrictVersion(repo, chart, version)
71 if err != nil {
72 return nil, err
73 }
74 }
75
76 cached, ok := r.cache.GetTemplateInitialValues(repo, chart, strictVersion, string(cyclopsv1alpha1.TemplateSourceTypeHelm))
77 if ok {
78 return cached, nil
79 }
80
81 tgzData, err := r.loadFromHelmChartRepo(repo, chart, version)
82 if err != nil {
83 return nil, err
84 }
85
86 extractedFiles, err := unpackTgzInMemory(tgzData)
87 if err != nil {
88 return nil, err
89 }
90
91 initial, err := r.mapHelmChartInitialValues(extractedFiles)
92 if err != nil {
93 return nil, err
94 }
95
96 r.cache.SetTemplateInitialValues(repo, chart, strictVersion, string(cyclopsv1alpha1.TemplateSourceTypeHelm), initial)
97
98 return initial, nil
99}
100
101func IsHelmRepo(repo string) (bool, error) {
102 indexURL, err := url.JoinPath(repo, "index.yaml")

Callers 1

Calls 7

loadFromHelmChartRepoMethod · 0.95
isValidVersionFunction · 0.85
getRepoStrictVersionFunction · 0.85
unpackTgzInMemoryFunction · 0.85

Tested by

no test coverage detected