squadron/internal/helm/doc.go
Kevin Franklin Kim 4b88ffbd15
feat: bump linter
2025-10-10 11:54:31 +02:00

31 lines
564 B
Go

package helm
import (
"os"
"github.com/pkg/errors"
"gopkg.in/yaml.v3"
)
const (
chartAPIVersionV2 = "v2"
defaultChartType = "application" // application or library
chartFile = "Chart.yaml"
valuesFile = "values.yaml"
)
func loadChart(path string) (*Chart, error) {
c := Chart{}
file, err := os.ReadFile(path)
if err != nil {
return nil, errors.Wrap(err, "error while opening file")
}
if err := yaml.Unmarshal(file, &c); err != nil {
return nil, errors.Wrap(err, "error while unmarshalling template file")
}
return &c, nil
}