WIP: start adding values support
This commit is contained in:
@ -14,6 +14,7 @@ type Config struct {
|
||||
Repositories repository.Repositories
|
||||
Releases release.Releases
|
||||
Clusters cluster.Clusters
|
||||
ConfigPath string `yaml:"-"`
|
||||
}
|
||||
|
||||
// NewConfigFromFile populates the config struct from a configuration yaml file
|
||||
@ -27,5 +28,6 @@ func NewConfigFromFile(path string) (*Config, error) {
|
||||
if err := yaml.Unmarshal(configFile, &config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
config.ConfigPath = path
|
||||
return &config, nil
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package release
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"git.badhouseplants.net/allanger/shoebill/internal/config/repository"
|
||||
"git.badhouseplants.net/allanger/shoebill/internal/lockfile"
|
||||
@ -21,6 +22,8 @@ type Release struct {
|
||||
Version string
|
||||
// Namespace to install release
|
||||
Namespace string
|
||||
// Value files
|
||||
Values []string
|
||||
// Private fields that should be pupulated during the run-time
|
||||
RepositoryObj *repository.Repository `yaml:"-"`
|
||||
}
|
||||
@ -59,6 +62,12 @@ func (r *Release) VersionHandler(dir string, hh helmhelper.Helmhelper) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *Release) ValuesHandler(dir string) {
|
||||
for i := range r.Values {
|
||||
r.Values[i] = fmt.Sprintf("%s/%s", dir, strings.ReplaceAll(r.Values[i], "./", ""))
|
||||
}
|
||||
}
|
||||
|
||||
func FindReleaseByNames(releases []string, releasesObj Releases) Releases {
|
||||
result := Releases{}
|
||||
for _, rObj := range releasesObj {
|
||||
|
Reference in New Issue
Block a user