[lxc-devel] [lxd/master] image-handling.md: 'release' should be a string and not a list

TerraTech on Github lxc-bot at linuxcontainers.org
Thu Dec 27 12:31:10 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 1230 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20181227/a949c9cf/attachment.bin>
-------------- next part --------------
From 7fac9d3638cd75039d4d0b66b4117d3e946f4e5f Mon Sep 17 00:00:00 2001
From: fqbuild <TerraTech at users.noreply.github.com>
Date: Thu, 27 Dec 2018 07:22:10 -0500
Subject: [PATCH] image-handling.md: 'release' should be a string and not a
 list

  During 'lxc image import', yaml.Unmarshal() and is applied to the following struct:

  // ImageMetadata represents LXD image metadata
  type ImageMetadata struct {
	Architecture string                            `json:"architecture" yaml:"architecture"`
	CreationDate int64                             `json:"creation_date" yaml:"creation_date"`
	ExpiryDate   int64                             `json:"expiry_date" yaml:"expiry_date"`
	Properties   map[string]string                 `json:"properties" yaml:"properties"`
	Templates    map[string]*ImageMetadataTemplate `json:"templates" yaml:"templates"`
  }

  ImageMetadata.Properties is a map[string]string, and applying any property as a list will
  result in the following error:

  >> Error: Could not parse metadata.yaml: yaml: unmarshal errors:
  >> line 8: cannot unmarshal !!seq into string

Signed-off-by: fqbuild <TerraTech at users.noreply.github.com>
---
 doc/image-handling.md | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/doc/image-handling.md b/doc/image-handling.md
index 5451f0db08..7a3c79218a 100644
--- a/doc/image-handling.md
+++ b/doc/image-handling.md
@@ -100,9 +100,7 @@ creation_date: 1424284563
 properties:
   description: Ubuntu 14.04 LTS Intel 64bit
   os: Ubuntu
-  release:
-    - trusty
-    - 14.04
+  release: trusty 14.04
 templates:
   /etc/hosts:
     when:


More information about the lxc-devel mailing list