From 6991e9b8759d58d73a5c829db915e973695371d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Va=C5=A1ek?= Date: Thu, 3 Apr 2025 11:43:47 +0200 Subject: [PATCH 1/2] Make build binds more similar to runtime binds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matej Vašek --- pkg/functions/function.go | 6 +++--- schema/func_yaml-schema.json | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/functions/function.go b/pkg/functions/function.go index af70f8b27c..8357f63a08 100644 --- a/pkg/functions/function.go +++ b/pkg/functions/function.go @@ -150,12 +150,12 @@ type BuildSpec struct { Image string `yaml:"-"` // Mounts used in build phase. This is useful in particular for paketo bindings. - Mounts []MountSpec `yaml:"mounts,omitempty"` + Mounts []MountSpec `yaml:"volumes,omitempty"` } type MountSpec struct { - Source string `yaml:"source"` - Destination string `yaml:"destination"` + Source string `yaml:"hostPath"` + Destination string `yaml:"path"` } // RunSpec diff --git a/schema/func_yaml-schema.json b/schema/func_yaml-schema.json index 74504ec390..7386c8570d 100644 --- a/schema/func_yaml-schema.json +++ b/schema/func_yaml-schema.json @@ -49,7 +49,7 @@ "type": "string", "description": "RemoteStorageClass specifies the storage class to use for the volume used\non-cluster during when built remotely." }, - "mounts": { + "volumes": { "items": { "$schema": "http://json-schema.org/draft-04/schema#", "$ref": "#/definitions/MountSpec" @@ -279,14 +279,14 @@ }, "MountSpec": { "required": [ - "source", - "destination" + "hostPath", + "path" ], "properties": { - "source": { + "hostPath": { "type": "string" }, - "destination": { + "path": { "type": "string" } }, From 3ab838a15997270c531285b370d0081119f53945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Va=C5=A1ek?= Date: Thu, 3 Apr 2025 11:51:00 +0200 Subject: [PATCH 2/2] Added comments on struct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matej Vašek --- pkg/functions/function.go | 4 +++- schema/func_yaml-schema.json | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/functions/function.go b/pkg/functions/function.go index 8357f63a08..a3cf6dc72c 100644 --- a/pkg/functions/function.go +++ b/pkg/functions/function.go @@ -154,7 +154,9 @@ type BuildSpec struct { } type MountSpec struct { - Source string `yaml:"hostPath"` + // Path on the local machine + Source string `yaml:"hostPath"` + // Path in the build container Destination string `yaml:"path"` } diff --git a/schema/func_yaml-schema.json b/schema/func_yaml-schema.json index 7386c8570d..ff0fe8d00f 100644 --- a/schema/func_yaml-schema.json +++ b/schema/func_yaml-schema.json @@ -284,10 +284,12 @@ ], "properties": { "hostPath": { - "type": "string" + "type": "string", + "description": "Path on the local machine" }, "path": { - "type": "string" + "type": "string", + "description": "Path in the build container" } }, "additionalProperties": false,