From 3511904644915a0eeff92d877a42059258618780 Mon Sep 17 00:00:00 2001 From: Iain Sproat Date: Mon, 10 Jun 2019 14:37:28 +0100 Subject: [PATCH 1/8] RFC for adding metadata related to source of app --- text/0006-app-layer-metadata-source.md | 102 +++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 text/0006-app-layer-metadata-source.md diff --git a/text/0006-app-layer-metadata-source.md b/text/0006-app-layer-metadata-source.md new file mode 100644 index 000000000..6e3af7b4f --- /dev/null +++ b/text/0006-app-layer-metadata-source.md @@ -0,0 +1,102 @@ +# Meta +[meta]: #meta +- Name: Manifest - App metadata - add source url & hash +- Start Date: 2019-06-10 +- CNB Pull Request: (leave blank) +- CNB Issue: (leave blank) +- Supersedes: N/A + +# Summary +[summary]: #summary + +Adds Source URL and hash properties to app metadata in the manifest, `Config.Labels."io.buildpacks.lifecycle.metadata".app`. + +# Motivation +[motivation]: #motivation + +- Why should we do this? +The provenance of the app should be transparent, and the image should be +reproducible. Providing metadata about the source URL and commit hash of the App assists +in achieving this. + +- What use cases does it support? +### Case 1 +This supports providing buildpack users, including users with quality assurance, legal or security roles, with data about the origin of packaged material. This helps in their understanding of the provenance of the app. + +### Case 2 +This supports providing a buildpack user with information that would allow them to attempt to reproduce the build/packaging. This may be done as part of a verification step related to the above use case. + +- What is the expected outcome? +Additional metadata would be provided to allow for verification of the source and reproduction of the build. + +# What it is +[what-it-is]: #what-it-is + +This feature adds additional metadata to the image manifest. It introduces two +new properties related to the App layer. These properties are the URL and hash +of the source. + +It is proposed that these properties would be added as children of `Config.Labels."io.buildpacks.lifecycle.metadata".app`. + +We propose `source.url` and `source.hash` properties. + +Example: +``` +{ + Config: { + Labels: { + "io.buildpacks.lifecycle.metadata":"{\"app\":{\"source\":{\"url\":\"https://github.com/buildpack/rfcs.git\", \"hash\":\"a33a985597b04c36aeefd6b17c4ef593adb5dc01\"}}}" + } + } +} +``` + +Unencoded, `io.buildpacks.lifecycle.metadata` is: +``` +{ + "app": { + "source": { + "url": "https://githubcom/buildpack/rfcs.git", + "hash": " a33a985597b04c36aeefd6b17c4ef593adb5dc01" + } + } +} +``` + +# How it Works +[how-it-works]: #how-it-works + +The lifecycle may be provided additional metadata values, and this should be marshalled to the image manifest. +Platforms may or may not use these additional properties. + +# Drawbacks +[drawbacks]: #drawbacks + +There may be a risk in the future that these suggested keys may not align with different potential future metadata schemas (e.g. to add additional keys). + +# Alternatives +[alternatives]: #alternatives + +We considered [OCI pre-defined annotation +keys](https://github.com/opencontainers/image-spec/blob/master/annotations.md#pre-defined-annotation-keys). +These are semantically applied at the image level. However, it is possible that the source +for building the image is separate from the source for building the app layer. +Therefore we need metadata to describe the app separately. + +# Prior Art +[prior-art]: #prior-art + +None known. + +# Unresolved Questions +[unresolved-questions]: #unresolved-questions + +- What parts of the design do you expect to be resolved before this gets merged? +The property names and schema should be agreed. +- What parts of the design do you expect to be resolved through implementation of the feature? +The entry point of this data into the lifecycle. We expect the data to be +provided by the platform, and for the lifecycle to write it verbatim into the +manifest without need to alter or otherwise manipulate the provided data. +- What related issues do you consider out of scope for this RFC that could be addressed in the future independently of the solution that comes out of this RFC? + + From 74a5985c1f176fa26ff21feb0455841b29e759c7 Mon Sep 17 00:00:00 2001 From: Katie Chapman Date: Mon, 10 Jun 2019 15:09:08 +0100 Subject: [PATCH 2/8] Fix the URL in the example metadata --- text/0006-app-layer-metadata-source.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/text/0006-app-layer-metadata-source.md b/text/0006-app-layer-metadata-source.md index 6e3af7b4f..db510c986 100644 --- a/text/0006-app-layer-metadata-source.md +++ b/text/0006-app-layer-metadata-source.md @@ -56,8 +56,8 @@ Unencoded, `io.buildpacks.lifecycle.metadata` is: { "app": { "source": { - "url": "https://githubcom/buildpack/rfcs.git", - "hash": " a33a985597b04c36aeefd6b17c4ef593adb5dc01" + "url": "https://github.com/buildpack/rfcs.git", + "hash": "a33a985597b04c36aeefd6b17c4ef593adb5dc01" } } } From aa73d6b887bbf106693dbd0f6f4f4dd611b5bafd Mon Sep 17 00:00:00 2001 From: Iain Sproat Date: Mon, 10 Jun 2019 15:22:02 +0100 Subject: [PATCH 3/8] Adds suggestions for the lifecycle implementation Amended formatting to make questions separate and distinct from responses. --- text/0006-app-layer-metadata-source.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/text/0006-app-layer-metadata-source.md b/text/0006-app-layer-metadata-source.md index db510c986..e490887fb 100644 --- a/text/0006-app-layer-metadata-source.md +++ b/text/0006-app-layer-metadata-source.md @@ -14,19 +14,20 @@ Adds Source URL and hash properties to app metadata in the manifest, `Config.Lab # Motivation [motivation]: #motivation -- Why should we do this? +- **Why should we do this?** The provenance of the app should be transparent, and the image should be reproducible. Providing metadata about the source URL and commit hash of the App assists in achieving this. -- What use cases does it support? +- **What use cases does it support?** ### Case 1 This supports providing buildpack users, including users with quality assurance, legal or security roles, with data about the origin of packaged material. This helps in their understanding of the provenance of the app. ### Case 2 This supports providing a buildpack user with information that would allow them to attempt to reproduce the build/packaging. This may be done as part of a verification step related to the above use case. -- What is the expected outcome? +- **What is the expected outcome?** + Additional metadata would be provided to allow for verification of the source and reproduction of the build. # What it is @@ -69,6 +70,8 @@ Unencoded, `io.buildpacks.lifecycle.metadata` is: The lifecycle may be provided additional metadata values, and this should be marshalled to the image manifest. Platforms may or may not use these additional properties. +In terms of the lifecycle implementation, this is likely to require an additional property to [Lifecycle Builder](https://github.com/buildpack/lifecycle/blob/af8b71578ed91303834ef57a7e3568ce3081f153/cmd/builder/main.go#L66-L75), the [Builder struct](https://github.com/buildpack/lifecycle/blob/af8b71578ed91303834ef57a7e3568ce3081f153/cmd/builder/main.go#L66-L75), plus the [AppMetadata struct](https://github.com/buildpack/lifecycle/blob/af8b71578ed91303834ef57a7e3568ce3081f153/metadata/metadata.go#L21-L23) and changes to the [exporter](https://github.com/buildpack/lifecycle/blob/af8b71578ed91303834ef57a7e3568ce3081f153/exporter.go#L50-L54). + # Drawbacks [drawbacks]: #drawbacks @@ -91,12 +94,16 @@ None known. # Unresolved Questions [unresolved-questions]: #unresolved-questions -- What parts of the design do you expect to be resolved before this gets merged? +- **What parts of the design do you expect to be resolved before this gets merged?** + The property names and schema should be agreed. -- What parts of the design do you expect to be resolved through implementation of the feature? + +- **What parts of the design do you expect to be resolved through implementation of the feature?** + The entry point of this data into the lifecycle. We expect the data to be provided by the platform, and for the lifecycle to write it verbatim into the manifest without need to alter or otherwise manipulate the provided data. -- What related issues do you consider out of scope for this RFC that could be addressed in the future independently of the solution that comes out of this RFC? +- **What related issues do you consider out of scope for this RFC that could be addressed in the future independently of the solution that comes out of this RFC?** +Adding further/arbitrary metadata related to the app. From 54304e0e162aea4024f491f61c7fee727e2f432d Mon Sep 17 00:00:00 2001 From: Iain Sproat Date: Mon, 10 Jun 2019 16:48:37 +0100 Subject: [PATCH 4/8] Renames url to uri and hash to sha Adds additional alternative and improves formatting and structure of pro/con of alternatives. --- text/0006-app-layer-metadata-source.md | 32 ++++++++++++++++---------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/text/0006-app-layer-metadata-source.md b/text/0006-app-layer-metadata-source.md index e490887fb..3c6e7c2df 100644 --- a/text/0006-app-layer-metadata-source.md +++ b/text/0006-app-layer-metadata-source.md @@ -1,6 +1,6 @@ # Meta [meta]: #meta -- Name: Manifest - App metadata - add source url & hash +- Name: Manifest - App metadata - add source uri & sha - Start Date: 2019-06-10 - CNB Pull Request: (leave blank) - CNB Issue: (leave blank) @@ -9,14 +9,14 @@ # Summary [summary]: #summary -Adds Source URL and hash properties to app metadata in the manifest, `Config.Labels."io.buildpacks.lifecycle.metadata".app`. +Adds Source uri and sha properties to app metadata in the manifest, `Config.Labels."io.buildpacks.lifecycle.metadata".app`. # Motivation [motivation]: #motivation - **Why should we do this?** The provenance of the app should be transparent, and the image should be -reproducible. Providing metadata about the source URL and commit hash of the App assists +reproducible. Providing metadata about the source uri and commit sha of the App assists in achieving this. - **What use cases does it support?** @@ -34,19 +34,19 @@ Additional metadata would be provided to allow for verification of the source an [what-it-is]: #what-it-is This feature adds additional metadata to the image manifest. It introduces two -new properties related to the App layer. These properties are the URL and hash +new properties related to the App layer. These properties are the uri and sha of the source. It is proposed that these properties would be added as children of `Config.Labels."io.buildpacks.lifecycle.metadata".app`. -We propose `source.url` and `source.hash` properties. +We propose `source.uri` and `source.sha` properties. Example: ``` { Config: { Labels: { - "io.buildpacks.lifecycle.metadata":"{\"app\":{\"source\":{\"url\":\"https://github.com/buildpack/rfcs.git\", \"hash\":\"a33a985597b04c36aeefd6b17c4ef593adb5dc01\"}}}" + "io.buildpacks.lifecycle.metadata":"{\"app\":{\"source\":{\"uri\":\"https://github.com/buildpack/rfcs.git\", \"sha\":\"a33a985597b04c36aeefd6b17c4ef593adb5dc01\"}}}" } } } @@ -57,8 +57,8 @@ Unencoded, `io.buildpacks.lifecycle.metadata` is: { "app": { "source": { - "url": "https://github.com/buildpack/rfcs.git", - "hash": "a33a985597b04c36aeefd6b17c4ef593adb5dc01" + "uri": "https://github.com/buildpack/rfcs.git", + "sha": "a33a985597b04c36aeefd6b17c4ef593adb5dc01" } } } @@ -80,11 +80,19 @@ There may be a risk in the future that these suggested keys may not align with d # Alternatives [alternatives]: #alternatives -We considered [OCI pre-defined annotation +1. We considered [OCI pre-defined annotation keys](https://github.com/opencontainers/image-spec/blob/master/annotations.md#pre-defined-annotation-keys). -These are semantically applied at the image level. However, it is possible that the source -for building the image is separate from the source for building the app layer. -Therefore we need metadata to describe the app separately. +* **Pro**: + * Follows existing OCI specification +* **Con**: + * it is possible that the source for building the image is separate from the source for building the app layer. This attribute would not allow both to be added, and would not allow differentiation between the two. +1. A buildpack could be created which would add the metadata. + * **Pro**: + * Does not have to be part of the specification. + * Extensible to additional buildpacks to provide different types of metadata (e.g. from other source control repositories) + * **Con**: + * This would require the buildpack user to specify this additional buildpack. + * This would put the metadata in the specific buildpack layer, and not with the other app metadata. # Prior Art [prior-art]: #prior-art From 84589bac7c36bddcb49e16511ac502fe7017026b Mon Sep 17 00:00:00 2001 From: Iain Sproat Date: Wed, 19 Jun 2019 09:57:58 +0100 Subject: [PATCH 5/8] revises property to `io.buildpacks.app.metadata` Renames `sha` to `ref`. --- text/0006-app-layer-metadata-source.md | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/text/0006-app-layer-metadata-source.md b/text/0006-app-layer-metadata-source.md index 3c6e7c2df..10c815a50 100644 --- a/text/0006-app-layer-metadata-source.md +++ b/text/0006-app-layer-metadata-source.md @@ -1,6 +1,6 @@ # Meta [meta]: #meta -- Name: Manifest - App metadata - add source uri & sha +- Name: Manifest - App metadata - add source uri & ref - Start Date: 2019-06-10 - CNB Pull Request: (leave blank) - CNB Issue: (leave blank) @@ -9,14 +9,16 @@ # Summary [summary]: #summary -Adds Source uri and sha properties to app metadata in the manifest, `Config.Labels."io.buildpacks.lifecycle.metadata".app`. +Adds `Config.Labels."io.buildpacks.app.metadata"` property to the manifest to hold app specific metadata. + +This RFC further proposes to add a source uri and ref properties to this new app metadata property, `Config.Labels."io.buildpacks.app.metadata".source.uri` & `Config.Labels."io.buildpacks.app.metadata".source.ref`. # Motivation [motivation]: #motivation - **Why should we do this?** The provenance of the app should be transparent, and the image should be -reproducible. Providing metadata about the source uri and commit sha of the App assists +reproducible. Providing metadata about the source uri and ref of the App assists in achieving this. - **What use cases does it support?** @@ -34,32 +36,30 @@ Additional metadata would be provided to allow for verification of the source an [what-it-is]: #what-it-is This feature adds additional metadata to the image manifest. It introduces two -new properties related to the App layer. These properties are the uri and sha +new properties related to the App layer. These properties are the uri and ref of the source. -It is proposed that these properties would be added as children of `Config.Labels."io.buildpacks.lifecycle.metadata".app`. +It is proposed that these properties would be added as children of `Config.Labels."io.buildpacks.app.metadata"`. -We propose `source.uri` and `source.sha` properties. +We propose `source.uri` and `source.ref` properties. Example: ``` { Config: { Labels: { - "io.buildpacks.lifecycle.metadata":"{\"app\":{\"source\":{\"uri\":\"https://github.com/buildpack/rfcs.git\", \"sha\":\"a33a985597b04c36aeefd6b17c4ef593adb5dc01\"}}}" + "io.buildpacks.app.metadata":"{\"source\":{\"uri\":\"https://github.com/buildpack/rfcs.git\", \"ref\":\"a33a985597b04c36aeefd6b17c4ef593adb5dc01\"}}" } } } ``` -Unencoded, `io.buildpacks.lifecycle.metadata` is: +Unencoded, `io.buildpacks.app.metadata` is: ``` { - "app": { - "source": { - "uri": "https://github.com/buildpack/rfcs.git", - "sha": "a33a985597b04c36aeefd6b17c4ef593adb5dc01" - } + "source": { + "uri": "https://github.com/buildpack/rfcs.git", + "ref": "a33a985597b04c36aeefd6b17c4ef593adb5dc01" } } ``` @@ -92,7 +92,7 @@ keys](https://github.com/opencontainers/image-spec/blob/master/annotations.md#pr * Extensible to additional buildpacks to provide different types of metadata (e.g. from other source control repositories) * **Con**: * This would require the buildpack user to specify this additional buildpack. - * This would put the metadata in the specific buildpack layer, and not with the other app metadata. + * This would put the metadata in the specific buildpack layer. # Prior Art [prior-art]: #prior-art From ed3c083e6965924ce9e90257e9b9a25d1fc22041 Mon Sep 17 00:00:00 2001 From: Shane Huston Date: Wed, 19 Jun 2019 17:55:07 +0100 Subject: [PATCH 6/8] Update RFC for app metadata to include the git branch --- text/0006-app-layer-metadata-source.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/text/0006-app-layer-metadata-source.md b/text/0006-app-layer-metadata-source.md index 10c815a50..2c00852d0 100644 --- a/text/0006-app-layer-metadata-source.md +++ b/text/0006-app-layer-metadata-source.md @@ -1,6 +1,6 @@ # Meta [meta]: #meta -- Name: Manifest - App metadata - add source uri & ref +- Name: Manifest - App metadata - add source uri, branch & ref - Start Date: 2019-06-10 - CNB Pull Request: (leave blank) - CNB Issue: (leave blank) @@ -11,14 +11,14 @@ Adds `Config.Labels."io.buildpacks.app.metadata"` property to the manifest to hold app specific metadata. -This RFC further proposes to add a source uri and ref properties to this new app metadata property, `Config.Labels."io.buildpacks.app.metadata".source.uri` & `Config.Labels."io.buildpacks.app.metadata".source.ref`. +This RFC further proposes to add a source uri, branch and ref properties to this new app metadata property, `Config.Labels."io.buildpacks.app.metadata".source.uri`, `Config.Labels."io.buildpacks.app.metadata".source.branch` & `Config.Labels."io.buildpacks.app.metadata".source.ref`. # Motivation [motivation]: #motivation - **Why should we do this?** The provenance of the app should be transparent, and the image should be -reproducible. Providing metadata about the source uri and ref of the App assists +reproducible. Providing metadata about the source uri, branch and ref of the App assists in achieving this. - **What use cases does it support?** @@ -35,20 +35,20 @@ Additional metadata would be provided to allow for verification of the source an # What it is [what-it-is]: #what-it-is -This feature adds additional metadata to the image manifest. It introduces two -new properties related to the App layer. These properties are the uri and ref +This feature adds additional metadata to the image manifest. It introduces +three new properties related to the App layer. These properties are the uri, branch and ref of the source. It is proposed that these properties would be added as children of `Config.Labels."io.buildpacks.app.metadata"`. -We propose `source.uri` and `source.ref` properties. +We propose `source.uri`, `source.branch` and `source.ref` properties. Example: ``` { Config: { Labels: { - "io.buildpacks.app.metadata":"{\"source\":{\"uri\":\"https://github.com/buildpack/rfcs.git\", \"ref\":\"a33a985597b04c36aeefd6b17c4ef593adb5dc01\"}}" + "io.buildpacks.app.metadata":"{\"source\":{\"uri\":\"https://github.com/buildpack/rfcs.git\", \"branch\":\"master\", \"ref\":\"a33a985597b04c36aeefd6b17c4ef593adb5dc01\"}}" } } } @@ -59,6 +59,7 @@ Unencoded, `io.buildpacks.app.metadata` is: { "source": { "uri": "https://github.com/buildpack/rfcs.git", + "branch": "master", "ref": "a33a985597b04c36aeefd6b17c4ef593adb5dc01" } } From bdcec349d5e8659318764fb5d0cd8a56d120a952 Mon Sep 17 00:00:00 2001 From: Christian McCarthy Date: Thu, 20 Jun 2019 10:07:32 +0100 Subject: [PATCH 7/8] Remove lifecycle changes from How It Works [#166813918] Signed-off-by: Shane Huston --- text/0006-app-layer-metadata-source.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0006-app-layer-metadata-source.md b/text/0006-app-layer-metadata-source.md index 2c00852d0..0a3fbc52a 100644 --- a/text/0006-app-layer-metadata-source.md +++ b/text/0006-app-layer-metadata-source.md @@ -71,7 +71,7 @@ Unencoded, `io.buildpacks.app.metadata` is: The lifecycle may be provided additional metadata values, and this should be marshalled to the image manifest. Platforms may or may not use these additional properties. -In terms of the lifecycle implementation, this is likely to require an additional property to [Lifecycle Builder](https://github.com/buildpack/lifecycle/blob/af8b71578ed91303834ef57a7e3568ce3081f153/cmd/builder/main.go#L66-L75), the [Builder struct](https://github.com/buildpack/lifecycle/blob/af8b71578ed91303834ef57a7e3568ce3081f153/cmd/builder/main.go#L66-L75), plus the [AppMetadata struct](https://github.com/buildpack/lifecycle/blob/af8b71578ed91303834ef57a7e3568ce3081f153/metadata/metadata.go#L21-L23) and changes to the [exporter](https://github.com/buildpack/lifecycle/blob/af8b71578ed91303834ef57a7e3568ce3081f153/exporter.go#L50-L54). +In terms of the lifecycle implementation, this is likely to require changes to the [exporter](https://github.com/buildpack/lifecycle/blob/af8b71578ed91303834ef57a7e3568ce3081f153/exporter.go#L50-L54) to add the additional app metadata. # Drawbacks [drawbacks]: #drawbacks From ba8b8d6d5a9d1fc309ff3064e72554e800fbfe8c Mon Sep 17 00:00:00 2001 From: Carlo Colombo Date: Tue, 16 Jul 2019 12:21:09 +0100 Subject: [PATCH 8/8] Update as per Stephen's comments [#167256379] Signed-off-by: Christian Mc Carthy --- text/0006-app-layer-metadata-source.md | 61 +++++++++++++++++++------- 1 file changed, 45 insertions(+), 16 deletions(-) diff --git a/text/0006-app-layer-metadata-source.md b/text/0006-app-layer-metadata-source.md index 0a3fbc52a..d9b924265 100644 --- a/text/0006-app-layer-metadata-source.md +++ b/text/0006-app-layer-metadata-source.md @@ -1,6 +1,6 @@ # Meta [meta]: #meta -- Name: Manifest - App metadata - add source uri, branch & ref +- Name: Manifest - App metadata - add source type, version and metadata - Start Date: 2019-06-10 - CNB Pull Request: (leave blank) - CNB Issue: (leave blank) @@ -9,17 +9,19 @@ # Summary [summary]: #summary -Adds `Config.Labels."io.buildpacks.app.metadata"` property to the manifest to hold app specific metadata. +Adds `Config.Labels."io.buildpacks.app.source"` property to the manifest to hold app specific source information. -This RFC further proposes to add a source uri, branch and ref properties to this new app metadata property, `Config.Labels."io.buildpacks.app.metadata".source.uri`, `Config.Labels."io.buildpacks.app.metadata".source.branch` & `Config.Labels."io.buildpacks.app.metadata".source.ref`. +This RFC further proposes to add type, version and metadata properties to this new app source property. +* `Config.Labels."io.buildpacks.app.source".type` (the type of the source - e.g. git, svn, image) +* `Config.Labels."io.buildpacks.app.source".version` (the version of the source - this depends on the source type - e.g commit for git or shasum for images) +* `Config.Labels."io.buildpacks.app.source".metadata` (additional metadata related to the source - e.g a git source branch and url, an image repository and digest) # Motivation [motivation]: #motivation - **Why should we do this?** The provenance of the app should be transparent, and the image should be -reproducible. Providing metadata about the source uri, branch and ref of the App assists -in achieving this. +reproducible. Providing information about the source of an App assists in achieving this. - **What use cases does it support?** ### Case 1 @@ -30,37 +32,64 @@ This supports providing a buildpack user with information that would allow them - **What is the expected outcome?** -Additional metadata would be provided to allow for verification of the source and reproduction of the build. +Additional source information would be provided to allow for verification of the source and reproduction of the build. # What it is [what-it-is]: #what-it-is -This feature adds additional metadata to the image manifest. It introduces -three new properties related to the App layer. These properties are the uri, branch and ref +This feature adds additional source information to the image manifest. It introduces +three new properties related to the App layer. These properties are the type, version and metadata of the source. -It is proposed that these properties would be added as children of `Config.Labels."io.buildpacks.app.metadata"`. +It is proposed that these properties would be added as children of `Config.Labels."io.buildpacks.app.source"`. -We propose `source.uri`, `source.branch` and `source.ref` properties. +We propose `type`, `version` and `metadata` properties. Example: + +Source: +``` +{ + Config: { + Labels: { + "io.buildpacks.app.source":"{\"type\":\"image\",\"version\":{\"digest\":\"146c4bce42545e6a4575283b32a7f01924ef86ce848273079693a42b52b27321\"},\"metadata\":{\"path\":\"/source\",\"repository\":\"hub.docker.io/example/image\",\"refs\":[\"example/image:mytag\"]}}" + } + } +} +``` + +Unencoded, `io.buildpacks.app.source` is: +``` +{ + "type": "image", + "version": { "digest": "146c4bce42545e6a4575283b32a7f01924ef86ce848273079693a42b52b27321" }, + "metadata": { + "path": "/source", + "repository": "hub.docker.io/example/image", + "refs": ["example/image:mytag"] + } +} +``` + +Git: ``` { Config: { Labels: { - "io.buildpacks.app.metadata":"{\"source\":{\"uri\":\"https://github.com/buildpack/rfcs.git\", \"branch\":\"master\", \"ref\":\"a33a985597b04c36aeefd6b17c4ef593adb5dc01\"}}" + "io.buildpacks.app.source":"{\"type\":\"git\",\"version\":{\"commit\":\"60d5fb7a7ad7c3b357a9d783b740f765d2a0d4d5\"},\"metadata\":{\"refs\":[\"master\",\"v3.0\"],\"url\":\"https://github.com/example/source\"}}" } } } ``` -Unencoded, `io.buildpacks.app.metadata` is: +Unencoded, `io.buildpacks.app.source` is: ``` { - "source": { - "uri": "https://github.com/buildpack/rfcs.git", - "branch": "master", - "ref": "a33a985597b04c36aeefd6b17c4ef593adb5dc01" + "type": "git", + "version": { "commit": "60d5fb7a7ad7c3b357a9d783b740f765d2a0d4d5" }, + "metadata": { + "refs": ["master", "v3.0"], + "url": "https://github.com/example/source" } } ```