Skip to content

Commit 802edf6

Browse files
cgwaltersopenshift-merge-robot
authored andcommittedMar 11, 2021
schema: Drop requirement on ostree transaction commit metadata
Things like `ostree-content-bytes-written` shouldn't be a hard requirement because they're really just transient information. Something changed recently for me such that rpm-ostree went into the "repository is on netfs" mode which disables the transaction commit, which in turn drops this metadata. And then without that metadata various cosa operations were dying messily for no reason. We should really take a harder look at the schema and what's required. But dropping these keys gets me `cosa meta --print-value ref` working again.
1 parent 45585d3 commit 802edf6

File tree

8 files changed

+6
-84
lines changed

8 files changed

+6
-84
lines changed
 

‎docs/gangplank/api-cosa.md

-42
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,7 @@ var generatedSchemaJSON = `{
240240
"buildid",
241241
"name",
242242
"ostree-commit",
243-
"ostree-content-bytes-written",
244243
"ostree-content-checksum",
245-
"ostree-n-cache-hits",
246-
"ostree-n-content-total",
247-
"ostree-n-content-written",
248-
"ostree-n-metadata-total",
249-
"ostree-n-metadata-written",
250244
"ostree-timestamp",
251245
"ostree-version",
252246
"rpm-ostree-inputhash",
@@ -609,49 +603,19 @@ var generatedSchemaJSON = `{
609603
"default":"",
610604
"minLength": 64
611605
},
612-
"ostree-content-bytes-written": {
613-
"$id":"#/properties/ostree-content-bytes-written",
614-
"type":"integer",
615-
"title":"ostree-content-bytes-written",
616-
"default": 0
617-
},
618606
"ostree-content-checksum": {
619607
"$id":"#/properties/ostree-content-checksum",
620608
"type":"string",
621609
"title":"ostree-content-checksum",
622610
"default":"",
623611
"minLength": 64
624612
},
625-
"ostree-n-cache-hits": {
626-
"$id":"#/properties/ostree-n-cache-hits",
627-
"type":"integer",
628-
"title":"ostree-n-cache-hits",
629-
"default": 0
630-
},
631613
"ostree-n-content-total": {
632614
"$id":"#/properties/ostree-n-content-total",
633615
"type":"integer",
634616
"title":"ostree-n-content-total",
635617
"default": 0
636618
},
637-
"ostree-n-content-written": {
638-
"$id":"#/properties/ostree-n-content-written",
639-
"type":"integer",
640-
"title":"ostree-n-content-written",
641-
"default": 0
642-
},
643-
"ostree-n-metadata-total": {
644-
"$id":"#/properties/ostree-n-metadata-total",
645-
"type":"integer",
646-
"title":"ostree-n-metadata-total",
647-
"default": 0
648-
},
649-
"ostree-n-metadata-written": {
650-
"$id":"#/properties/ostree-n-metadata-written",
651-
"type":"integer",
652-
"title":"ostree-n-metadata-written",
653-
"default": 0
654-
},
655619
"ostree-timestamp": {
656620
"$id":"#/properties/ostree-timestamp",
657621
"type":"string",
@@ -904,13 +868,7 @@ type Build struct {
904868
Name string `json:"name"`
905869
Oscontainer *Image `json:"oscontainer,omitempty"`
906870
OstreeCommit string `json:"ostree-commit"`
907-
OstreeContentBytesWritten int `json:"ostree-content-bytes-written"`
908871
OstreeContentChecksum string `json:"ostree-content-checksum"`
909-
OstreeNCacheHits int `json:"ostree-n-cache-hits"`
910-
OstreeNContentTotal int `json:"ostree-n-content-total"`
911-
OstreeNContentWritten int `json:"ostree-n-content-written"`
912-
OstreeNMetadataTotal int `json:"ostree-n-metadata-total"`
913-
OstreeNMetadataWritten int `json:"ostree-n-metadata-written"`
914872
OstreeTimestamp string `json:"ostree-timestamp"`
915873
OstreeVersion string `json:"ostree-version"`
916874
OverridesActive bool `json:"coreos-assembler.overrides-active,omitempty"`

‎fixtures/fcos.json

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
{
22
"ref": "fedora/x86_64/coreos/testing-devel",
3-
"ostree-n-metadata-total": 9137,
4-
"ostree-n-metadata-written": 21,
5-
"ostree-n-content-total": 4774,
6-
"ostree-n-content-written": 24,
7-
"ostree-n-cache-hits": 15605,
8-
"ostree-content-bytes-written": 76970521,
93
"ostree-commit": "981ddd48f99d8d30caa85c81e02ab4f0d20b957f031db81b7bccfe8f54b679ce",
104
"ostree-content-checksum": "a2ba5f894b56613d92f236ffc98719b18a6838081c24dd33f04fce3bdf366d82",
115
"ostree-version": "31.20200310.20.0",

‎fixtures/rhcos.json

-6
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,7 @@
9898
"image": "registry.svc.ci.openshift.org/rhcos-devel/machine-os-content"
9999
},
100100
"ostree-commit": "9665ab0cfd4a995cf70f1a3bb678d3515a03f7d3b5bb87d723ba06c26f0daa6e",
101-
"ostree-content-bytes-written": 156269945,
102101
"ostree-content-checksum": "e02647edba305ad68e2c7c5bb3a2c7765eb4ea6aadd1ebf8e538e459ebf99ed7",
103-
"ostree-n-cache-hits": 19185,
104-
"ostree-n-content-total": 3688,
105-
"ostree-n-content-written": 1210,
106-
"ostree-n-metadata-total": 9225,
107-
"ostree-n-metadata-written": 3015,
108102
"ostree-timestamp": "2020-01-15T19:31:31Z",
109103
"ostree-version": "44devel.81.202001151926.0",
110104
"pkgdiff": [

‎gangplank/cosa/schema_doc.go

-6
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,7 @@ var generatedSchemaJSON = `{
162162
"buildid",
163163
"name",
164164
"ostree-commit",
165-
"ostree-content-bytes-written",
166165
"ostree-content-checksum",
167-
"ostree-n-cache-hits",
168-
"ostree-n-content-total",
169-
"ostree-n-content-written",
170-
"ostree-n-metadata-total",
171-
"ostree-n-metadata-written",
172166
"ostree-timestamp",
173167
"ostree-version",
174168
"rpm-ostree-inputhash",

‎gangplank/cosa/v1.go

-6
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,7 @@ type Build struct {
4949
Name string `json:"name"`
5050
Oscontainer *Image `json:"oscontainer,omitempty"`
5151
OstreeCommit string `json:"ostree-commit"`
52-
OstreeContentBytesWritten int `json:"ostree-content-bytes-written"`
5352
OstreeContentChecksum string `json:"ostree-content-checksum"`
54-
OstreeNCacheHits int `json:"ostree-n-cache-hits"`
55-
OstreeNContentTotal int `json:"ostree-n-content-total"`
56-
OstreeNContentWritten int `json:"ostree-n-content-written"`
57-
OstreeNMetadataTotal int `json:"ostree-n-metadata-total"`
58-
OstreeNMetadataWritten int `json:"ostree-n-metadata-written"`
5953
OstreeTimestamp string `json:"ostree-timestamp"`
6054
OstreeVersion string `json:"ostree-version"`
6155
OverridesActive bool `json:"coreos-assembler.overrides-active,omitempty"`

‎mantle/cosa/cosa_v1.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ type Build struct {
5050
Name string `json:"name"`
5151
Oscontainer *Image `json:"oscontainer,omitempty"`
5252
OstreeCommit string `json:"ostree-commit"`
53-
OstreeContentBytesWritten int `json:"ostree-content-bytes-written"`
53+
OstreeContentBytesWritten int `json:"ostree-content-bytes-written,omitempty"`
5454
OstreeContentChecksum string `json:"ostree-content-checksum"`
55-
OstreeNCacheHits int `json:"ostree-n-cache-hits"`
56-
OstreeNContentTotal int `json:"ostree-n-content-total"`
57-
OstreeNContentWritten int `json:"ostree-n-content-written"`
58-
OstreeNMetadataTotal int `json:"ostree-n-metadata-total"`
59-
OstreeNMetadataWritten int `json:"ostree-n-metadata-written"`
55+
OstreeNCacheHits int `json:"ostree-n-cache-hits,omitempty"`
56+
OstreeNContentTotal int `json:"ostree-n-content-total,omitempty"`
57+
OstreeNContentWritten int `json:"ostree-n-content-written,omitempty"`
58+
OstreeNMetadataTotal int `json:"ostree-n-metadata-total,omitempty"`
59+
OstreeNMetadataWritten int `json:"ostree-n-metadata-written,omitempty"`
6060
OstreeTimestamp string `json:"ostree-timestamp"`
6161
OstreeVersion string `json:"ostree-version"`
6262
OverridesActive bool `json:"coreos-assembler.overrides-active,omitempty"`

‎mantle/cosa/schema_doc.go

-6
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,7 @@ var generatedSchemaJSON = `{
162162
"buildid",
163163
"name",
164164
"ostree-commit",
165-
"ostree-content-bytes-written",
166165
"ostree-content-checksum",
167-
"ostree-n-cache-hits",
168-
"ostree-n-content-total",
169-
"ostree-n-content-written",
170-
"ostree-n-metadata-total",
171-
"ostree-n-metadata-written",
172166
"ostree-timestamp",
173167
"ostree-version",
174168
"rpm-ostree-inputhash",

‎src/schema/v1.json

-6
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,7 @@
157157
"buildid",
158158
"name",
159159
"ostree-commit",
160-
"ostree-content-bytes-written",
161160
"ostree-content-checksum",
162-
"ostree-n-cache-hits",
163-
"ostree-n-content-total",
164-
"ostree-n-content-written",
165-
"ostree-n-metadata-total",
166-
"ostree-n-metadata-written",
167161
"ostree-timestamp",
168162
"ostree-version",
169163
"rpm-ostree-inputhash",

0 commit comments

Comments
 (0)
Please sign in to comment.