[lxc-devel] [lxd/master] simplestreams: Align JSON struct for images.json

geaaru on Github lxc-bot at linuxcontainers.org
Sun Mar 24 13:37:06 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 361 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190324/2d4ead39/attachment.bin>
-------------- next part --------------
From 7423f3f55334fe5aed0b516e499e6b5b68cc2a0f Mon Sep 17 00:00:00 2001
From: Daniele Rondina <geaaru at sabayonlinux.org>
Date: Sun, 24 Mar 2019 14:35:47 +0100
Subject: [PATCH] simplestreams: Align JSON struct for images.json

Signed-off-by: Daniele Rondina <geaaru at sabayonlinux.org>
---
 shared/simplestreams/simplestreams.go | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/shared/simplestreams/simplestreams.go b/shared/simplestreams/simplestreams.go
index cc94c968f0..61b6fa1bec 100644
--- a/shared/simplestreams/simplestreams.go
+++ b/shared/simplestreams/simplestreams.go
@@ -274,30 +274,30 @@ type SimpleStreamsManifestProduct struct {
 	Architecture    string                                         `json:"arch"`
 	OperatingSystem string                                         `json:"os"`
 	Release         string                                         `json:"release"`
-	ReleaseCodename string                                         `json:"release_codename"`
+	ReleaseCodename string                                         `json:"release_codename,omitempty"`
 	ReleaseTitle    string                                         `json:"release_title"`
-	Supported       bool                                           `json:"supported"`
-	SupportedEOL    string                                         `json:"support_eol"`
-	Version         string                                         `json:"version"`
+	Supported       bool                                           `json:"supported,omitempty"`
+	SupportedEOL    string                                         `json:"support_eol,omitempty"`
+	Version         string                                         `json:"version,omitempty"`
 	Versions        map[string]SimpleStreamsManifestProductVersion `json:"versions"`
 }
 
 type SimpleStreamsManifestProductVersion struct {
-	PublicName string                                             `json:"pubname"`
-	Label      string                                             `json:"label"`
+	PublicName string                                             `json:"pubname,omitempty"`
+	Label      string                                             `json:"label,omitempty"`
 	Items      map[string]SimpleStreamsManifestProductVersionItem `json:"items"`
 }
 
 type SimpleStreamsManifestProductVersionItem struct {
 	Path                  string `json:"path"`
 	FileType              string `json:"ftype"`
-	HashMd5               string `json:"md5"`
-	HashSha256            string `json:"sha256"`
-	LXDHashSha256         string `json:"combined_sha256"`
-	LXDHashSha256RootXz   string `json:"combined_rootxz_sha256"`
-	LXDHashSha256SquashFs string `json:"combined_squashfs_sha256"`
+	HashMd5               string `json:"md5,omitempty"`
+	HashSha256            string `json:"sha256,omitempty"`
+	LXDHashSha256         string `json:"combined_sha256,omitempty"`
+	LXDHashSha256RootXz   string `json:"combined_rootxz_sha256,omitempty"`
+	LXDHashSha256SquashFs string `json:"combined_squashfs_sha256,omitempty"`
 	Size                  int64  `json:"size"`
-	DeltaBase             string `json:"delta_base"`
+	DeltaBase             string `json:"delta_base,omitempty"`
 }
 
 type SimpleStreamsIndex struct {


More information about the lxc-devel mailing list