From 617f6759e89df6a3b31b94e465bbba027330803f Mon Sep 17 00:00:00 2001 From: Markus Rudy Date: Wed, 7 Aug 2024 12:31:10 +0200 Subject: [PATCH] release: set platform for resourcegen --- internal/kuberesource/resourcegen/main.go | 23 +++++++++++------------ packages/scripts.nix | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/internal/kuberesource/resourcegen/main.go b/internal/kuberesource/resourcegen/main.go index 734093fe87..e568427e2a 100644 --- a/internal/kuberesource/resourcegen/main.go +++ b/internal/kuberesource/resourcegen/main.go @@ -28,19 +28,18 @@ func main() { flag.Parse() - var platform platforms.Platform - var runtimeHandler string - if *rawPlatform != "" { - var err error - platform, err = platforms.FromString(*rawPlatform) - if err != nil { - log.Fatalf("Error parsing platform: %v", err) - } + if *rawPlatform == "" { + log.Fatalf("--platform must be set to one of %v", platforms.AllStrings()) + } - runtimeHandler, err = manifest.RuntimeHandler(platform) - if err != nil { - log.Fatalf("Error getting default runtime handler: %v", err) - } + platform, err := platforms.FromString(*rawPlatform) + if err != nil { + log.Fatalf("Error parsing platform: %v", err) + } + + runtimeHandler, err := manifest.RuntimeHandler(platform) + if err != nil { + log.Fatalf("Error getting default runtime handler: %v", err) } var resources []any diff --git a/packages/scripts.nix b/packages/scripts.nix index 8c22949bd3..fe6cf6663e 100644 --- a/packages/scripts.nix +++ b/packages/scripts.nix @@ -165,7 +165,7 @@ trap 'rm -rf $tmpdir' EXIT echo "ghcr.io/edgelesssys/contrast/coordinator:latest=$imageRef" > "$tmpdir/image-replacements.txt" - resourcegen --image-replacements "$tmpdir/image-replacements.txt" --add-load-balancers coordinator > "$tmpdir/coordinator_base.yml" + resourcegen --platform AKS-CLH-SNP --image-replacements "$tmpdir/image-replacements.txt" --add-load-balancers coordinator > "$tmpdir/coordinator_base.yml" pushd "$tmpdir" >/dev/null cp ${pkgs.microsoft.genpolicy.rules-coordinator}/genpolicy-rules.rego rules.rego