From d3e33738b9f8f5bc77c610584947888ab3afe76b Mon Sep 17 00:00:00 2001 From: Luke Kingland Date: Tue, 6 Jun 2023 03:29:26 +0900 Subject: [PATCH] src: add missing 'omitempty' annotations (#1773) --- pkg/functions/function.go | 4 ++-- schema/func_yaml-schema.json | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/functions/function.go b/pkg/functions/function.go index a7f084d9..ea94983d 100644 --- a/pkg/functions/function.go +++ b/pkg/functions/function.go @@ -53,7 +53,7 @@ type Function struct { // Registry at which to store interstitial containers, in the form // [registry]/[user]. - Registry string `yaml:"registry"` + Registry string `yaml:"registry,omitempty"` // Optional full OCI image tag in form: // [registry]/[namespace]/[name]:[tag] @@ -64,7 +64,7 @@ type Function struct { // alice/my.function.name // If Image is provided, it overrides the default of concatenating // "Registry+Name:latest" to derive the Image. - Image string `yaml:"image"` + Image string `yaml:"image,omitempty"` // SHA256 hash of the latest image that has been built ImageDigest string `yaml:"imageDigest,omitempty"` diff --git a/schema/func_yaml-schema.json b/schema/func_yaml-schema.json index 81d11576..0a4713ac 100644 --- a/schema/func_yaml-schema.json +++ b/schema/func_yaml-schema.json @@ -122,8 +122,6 @@ "Function": { "required": [ "specVersion", - "registry", - "image", "created" ], "properties": {