Skip to content

Commit

Permalink
cmd-push-container-manifest: add container tags pushed to meta.json
Browse files Browse the repository at this point in the history
For FCOS, we'll eventually want to add the oscontainer image in the
stream metadata. We'll want it to be tag-based so that by default, users
always use the latest release.

Add a `tags` key to the image definition for this.

We include all the tags instead of just e.g. the first one, because I
think it's good practice to have `meta.json` reference all the external
resources that it pushed to. This is important for example for GC.
  • Loading branch information
jlebon committed Oct 21, 2022
1 parent c7b5757 commit f9418fd
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 5 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion pkg/builds/cosa_v1.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package builds

// generated by 'make schema'
// source hash: 1e32ab25dfdd0724f8e8246008b9d91b88a40e9ea834cf779ab0da818bf1cf25
// source hash: ce57421ef973f926c59065fd4eb122d5d22fe76681f952376091631178ce5dc1

type AdvisoryDiff []AdvisoryDiffItems

Expand Down Expand Up @@ -148,6 +148,7 @@ type Image struct {
Comment string `json:"comment,omitempty"`
Digest string `json:"digest,omitempty"`
Image string `json:"image"`
Tags []Tag `json:"tags,omitempty"`
}

type Koji struct {
Expand All @@ -169,3 +170,5 @@ type S3 struct {
Key string `json:"key,omitempty"`
PublicURL string `json:"public-url,omitempty"`
}

type Tag string
13 changes: 12 additions & 1 deletion pkg/builds/schema_doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated by ./generate-schema.sh
// Source hash: 1e32ab25dfdd0724f8e8246008b9d91b88a40e9ea834cf779ab0da818bf1cf25
// Source hash: ce57421ef973f926c59065fd4eb122d5d22fe76681f952376091631178ce5dc1
// DO NOT EDIT

package builds
Expand Down Expand Up @@ -60,6 +60,7 @@ var generatedSchemaJSON = `{
],
"optional": [
"digest",
"tags",
"comment"
],
"properties": {
Expand All @@ -77,6 +78,16 @@ var generatedSchemaJSON = `{
"$id": "#/image/image",
"type": "string",
"title": "Image"
},
"tags": {
"$id": "#/image/tags",
"type": "array",
"title": "Tags",
"items": {
"$id": "#/image/tags/item",
"title": "Tag",
"type": "string"
}
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion src/cmd-push-container-manifest
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def main():
arch = 'x86_64'
buildmetas[arch][args.metajsonname] = {
'image': args.repo,
'digest': manifest['digest']
'digest': manifest['digest'],
'tags': args.tags
}
buildmetas[arch].write(artifact_name=args.metajsonname)

Expand Down
11 changes: 11 additions & 0 deletions src/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
],
"optional": [
"digest",
"tags",
"comment"
],
"properties": {
Expand All @@ -71,6 +72,16 @@
"$id": "#/image/image",
"type": "string",
"title": "Image"
},
"tags": {
"$id": "#/image/tags",
"type": "array",
"title": "Tags",
"items": {
"$id": "#/image/tags/item",
"title": "Tag",
"type": "string"
}
}
}
},
Expand Down

0 comments on commit f9418fd

Please sign in to comment.