mirror of
https://github.com/holos-run/holos.git
synced 2026-03-20 17:25:01 +00:00
With this patch the first use case of CUE Resources + Kustomize is fully working, artifacts are written into the deploy directory. ❯ holos render platform ./platforms/minimal rendered namespaces for cluster local in 143.068583ms rendered namespaces for cluster local in 143.861834ms rendered namespaces for cluster local in 144.072666ms rendered namespaces for cluster local in 144.219417ms rendered platform in 144.326625ms The output indicates we need to plumb the BuildPlan metadata.name from the PlatfromSpec through to the render component command. This is necessary so we can report the correct name instead of just the base path.
28 lines
798 B
Go
28 lines
798 B
Go
package render
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/holos-run/holos"
|
|
"github.com/holos-run/holos/internal/artifact"
|
|
"github.com/holos-run/holos/internal/errors"
|
|
)
|
|
|
|
// Platform renders a platform, writing fully rendered manifests to files.
|
|
func Platform(ctx context.Context, builder holos.Builder) error {
|
|
// Artifacts are currently written by each `holos render component`
|
|
// subprocess, not the parent `holos render platform` process.
|
|
if err := builder.Build(ctx, artifact.New()); err != nil {
|
|
return errors.Wrap(err)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Component renders a component writing fully rendered manifests to files.
|
|
func Component(ctx context.Context, builder holos.Builder, am holos.ArtifactMap) error {
|
|
if err := builder.Build(ctx, am); err != nil {
|
|
return errors.Wrap(err)
|
|
}
|
|
return nil
|
|
}
|