2024-04-24 23:06:45 +02:00
|
|
|
package labelStructs
|
|
|
|
|
|
|
|
import "gopkg.in/yaml.v3"
|
|
|
|
|
|
|
|
// Dependency is a dependency of a chart to other charts.
|
|
|
|
type Dependency struct {
|
2024-10-17 17:08:42 +02:00
|
|
|
Values map[string]any `yaml:"-"`
|
2024-04-24 23:06:45 +02:00
|
|
|
Name string `yaml:"name"`
|
|
|
|
Version string `yaml:"version"`
|
|
|
|
Repository string `yaml:"repository"`
|
|
|
|
Alias string `yaml:"alias,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// DependenciesFrom returns a slice of dependencies from the given string.
|
|
|
|
func DependenciesFrom(data string) ([]Dependency, error) {
|
|
|
|
var mapping []Dependency
|
|
|
|
if err := yaml.Unmarshal([]byte(data), &mapping); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return mapping, nil
|
|
|
|
}
|