[lxc-devel] [lxd/master] Don't block RBAC on startup

stgraber on Github lxc-bot at linuxcontainers.org
Mon Dec 2 05:51:13 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 425 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20191201/cfcc21ce/attachment.bin>
-------------- next part --------------
From 8381471efe0c6878968e8391de7d406624f20cf3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sun, 1 Dec 2019 23:52:06 -0500
Subject: [PATCH 1/2] lxd/seccomp: Fix golint
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>
---
 lxd/seccomp/seccomp.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/seccomp/seccomp.go b/lxd/seccomp/seccomp.go
index 28ff87a1bc..b9695b792a 100644
--- a/lxd/seccomp/seccomp.go
+++ b/lxd/seccomp/seccomp.go
@@ -1216,7 +1216,7 @@ var mountFlagsToOptMap = map[C.ulong]string{
 }
 
 func mountFlagsToOpts(flags C.ulong) string {
-	var currentBit C.ulong = 0
+	var currentBit C.ulong
 	opts := ""
 	var msRec C.ulong = (flags & C.MS_REC)
 

From c14d02abe3565fc41f82cd04920d3f5f6fee06be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 2 Dec 2019 00:15:56 -0500
Subject: [PATCH 2/2] lxd/daemon: Don't block on RBAC
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>
---
 lxd/daemon.go | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/lxd/daemon.go b/lxd/daemon.go
index a1d09b2b24..0e58df8b5d 100644
--- a/lxd/daemon.go
+++ b/lxd/daemon.go
@@ -1253,11 +1253,18 @@ func (d *Daemon) setupRBACServer(rbacURL string, rbacKey string, rbacExpiry int6
 		return result, err
 	}
 
-	// Perform full sync
-	err = server.SyncProjects()
-	if err != nil {
-		return err
-	}
+	// Perform full sync when online
+	go func() {
+		for {
+			err = server.SyncProjects()
+			if err != nil {
+				time.Sleep(time.Minute)
+				continue
+			}
+
+			break
+		}
+	}()
 
 	server.StartStatusCheck()
 


More information about the lxc-devel mailing list