mirror of
https://github.com/hauler-dev/hauler.git
synced 2026-03-27 13:57:19 +00:00
ensure templating works for bundles identified through fleet.yaml
This commit is contained in:
@@ -50,14 +50,27 @@ func MapImager(imager ...Imager) (map[name.Reference]v1.Image, error) {
|
||||
}
|
||||
|
||||
func ImageMapFromBundle(b *fleetapi.Bundle) (map[name.Reference]v1.Image, error) {
|
||||
opts := fleetapi.BundleDeploymentOptions{
|
||||
DefaultNamespace: "default",
|
||||
opts := fleetapi.BundleDeploymentOptions{}
|
||||
|
||||
if b.Spec.Helm != nil {
|
||||
opts.Helm = &fleetapi.HelmOptions{
|
||||
Chart: b.Spec.Helm.Chart,
|
||||
Repo: b.Spec.Helm.Repo,
|
||||
ReleaseName: b.Spec.Helm.ReleaseName,
|
||||
Version: b.Spec.Helm.Version,
|
||||
Values: b.Spec.Helm.Values,
|
||||
ValuesFrom: b.Spec.Helm.ValuesFrom,
|
||||
ValuesFiles: b.Spec.Helm.ValuesFiles,
|
||||
}
|
||||
}
|
||||
|
||||
m := &manifest.Manifest{Resources: b.Spec.Resources}
|
||||
m, err := manifest.New(&b.Spec)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
//TODO: I think this is right?
|
||||
objs, err := helmdeployer.Template("anything", m, opts)
|
||||
objs, err := helmdeployer.Template(b.Name, m, opts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -144,6 +157,7 @@ func parseJSONPath(input interface{}, parser *jsonpath.JSONPath, template string
|
||||
return nil, err
|
||||
}
|
||||
|
||||
r := strings.Split(buf.String(), " ")
|
||||
f := func(s rune) bool { return s == ' ' }
|
||||
r := strings.FieldsFunc(buf.String(), f)
|
||||
return r, nil
|
||||
}
|
||||
|
||||
@@ -57,7 +57,9 @@ func (p pkg) Archive(a Archiver, pkg v1alpha1.Package, output string) error {
|
||||
func (p pkg) PackageBundles(ctx context.Context, path ...string) ([]*fleetapi.Bundle, error) {
|
||||
p.logger.Infof("Packaging %d bundle(s)", len(path))
|
||||
|
||||
opts := &bundle.Options{Compress: true}
|
||||
opts := &bundle.Options{
|
||||
Compress: true,
|
||||
}
|
||||
|
||||
var cImgs int
|
||||
|
||||
|
||||
Reference in New Issue
Block a user