Skip to content

Commit

Permalink
support yaml encodings of platters
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmdm committed Feb 18, 2024
1 parent 20fc25f commit 8f4cde7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/halloumi/cmd_takeoff.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"context"
_ "embed"
"encoding/json"
"errors"
"flag"
"fmt"
Expand All @@ -15,6 +14,7 @@ import (
"strings"

"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/util/yaml"
"k8s.io/client-go/tools/clientcmd"

"github.com/davidmdm/x/xerr"
Expand Down Expand Up @@ -94,7 +94,7 @@ func TakeOff(ctx context.Context, params TakeoffParams) error {
}

var resources internal.List[*unstructured.Unstructured]
if err := json.Unmarshal(output, &resources); err != nil {
if err := yaml.Unmarshal(output, &resources); err != nil {
return fmt.Errorf("failed to unmarshal raw resources: %w", err)
}

Expand Down
4 changes: 3 additions & 1 deletion internal/unmarshalling.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package internal

import "encoding/json"
import (
"encoding/json"
)

type List[T any] []T

Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Halloumi is a Helm-inspired infrastructure-as-code (IaC) package deployer.

The philosophy behind Halloumi is that Kubernetes packages should be described via code. Programming environments have control flow, test frameworks, static typing, documentation, error management, and versioning. They are ideal for building contracts and enforcing them.

Halloumi deploys "platters" to Kubernetes (think helm charts or packages). A platter is a wasm executable that outputs the Kubernetes resources making up the package as JSON to stdout.
Halloumi deploys "platters" to Kubernetes (think helm charts or packages). A platter is a wasm executable that outputs the Kubernetes resources making up the package as JSON/YAML to stdout.

Halloumi embeds a pure-Go wasm runtime (wazero) and deploys your platter to Kubernetes. It keeps track of the different revisions for any given release and provides capabilities such as rollbacks and inspection. For ArgoCD compatibility, it can render the platter to the filesystem as raw YAML resources.

Expand Down

0 comments on commit 8f4cde7

Please sign in to comment.