From aae268323122da1f007c2c53cb064963b76527b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Va=C5=A1ek?= Date: Thu, 3 Apr 2025 12:19:05 +0200 Subject: [PATCH] Make build binds more similar to runtime binds (#2768) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Make build binds more similar to runtime binds Signed-off-by: Matej Vašek * Added comments on struct Signed-off-by: Matej Vašek --------- Signed-off-by: Matej Vašek --- pkg/functions/function.go | 8 +++++--- schema/func_yaml-schema.json | 16 +++++++++------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/pkg/functions/function.go b/pkg/functions/function.go index af70f8b2..a3cf6dc7 100644 --- a/pkg/functions/function.go +++ b/pkg/functions/function.go @@ -150,12 +150,14 @@ 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"` + // Path on the local machine + Source string `yaml:"hostPath"` + // Path in the build container + Destination string `yaml:"path"` } // RunSpec diff --git a/schema/func_yaml-schema.json b/schema/func_yaml-schema.json index 74504ec3..ff0fe8d0 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,15 +279,17 @@ }, "MountSpec": { "required": [ - "source", - "destination" + "hostPath", + "path" ], "properties": { - "source": { - "type": "string" + "hostPath": { + "type": "string", + "description": "Path on the local machine" }, - "destination": { - "type": "string" + "path": { + "type": "string", + "description": "Path in the build container" } }, "additionalProperties": false,