[lxc-devel] [lxd/master] shared/generate: Support instance.Type

stgraber on Github lxc-bot at linuxcontainers.org
Tue Sep 24 19:47:07 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190924/a7238268/attachment.bin>
-------------- next part --------------
From eb6187cabfae1173702b7429be56905ee0563124 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 24 Sep 2019 14:59:43 -0400
Subject: [PATCH] shared/generate: Support instance.Type
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: St├ęphane Graber <stgraber at ubuntu.com>
---
 shared/generate/db/mapping.go | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/shared/generate/db/mapping.go b/shared/generate/db/mapping.go
index 2a85e63ed0..ecb846db91 100644
--- a/shared/generate/db/mapping.go
+++ b/shared/generate/db/mapping.go
@@ -197,7 +197,7 @@ func (f *Field) ZeroValue() string {
 	switch f.Type.Name {
 	case "string":
 		return `""`
-	case "int":
+	case "int", "instance.Type":
 		// FIXME: we use -1 since at the moment integer criteria are
 		// required to be positive.
 		return "-1"
@@ -273,7 +273,8 @@ func IsColumnType(name string) bool {
 
 var columnarTypeNames = []string{
 	"bool",
-	"string",
+	"instance.Type",
 	"int",
+	"string",
 	"time.Time",
 }


More information about the lxc-devel mailing list