[prev in list] [next in list] [prev in thread] [next in thread]
List: lxc-devel
Subject: [lxc-devel] [lxd-demo-server/master] Make container/image profiles configurable
From: rsommer on Github <lxc-bot () linuxcontainers ! org>
Date: 2017-02-23 15:47:20
Message-ID: 20170223154720.1E52D3F0BA () mailman01 ! srv ! dcmtl ! stgraber ! net
[Download RAW message or body]
[Attachment #2 (text/x-mailbox)]
The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd-demo-server/pull/9
This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.
=== Description (from pull-request) ===
When using the demo server for your own purpose, being able to change the applied \
profile(s) may come in handy.
[Attachment #3 (text/plain)]
From 23fffaee0df47e301e861d6972b5d964b33a6c2c Mon Sep 17 00:00:00 2001
From: Roland Sommer <rol@ndsommer.de>
Date: Thu, 23 Feb 2017 16:41:07 +0100
Subject: [PATCH] Make container/image profiles configurable
---
lxd-demo.yaml.example | 3 +++
main.go | 5 +++--
rest.go | 4 ++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/lxd-demo.yaml.example b/lxd-demo.yaml.example
index 2fca6ef..c512db0 100644
--- a/lxd-demo.yaml.example
+++ b/lxd-demo.yaml.example
@@ -1,5 +1,8 @@
container: "my-base-container"
image: "my-image"
+profiles:
+ - default
+ - docker
feedback: true
feedback_timeout: 30
quota_cpu: 1
diff --git a/main.go b/main.go
index 1c87d90..3d1d10b 100644
--- a/main.go
+++ b/main.go
@@ -22,8 +22,9 @@ var lxdDaemon *lxd.Client
var config serverConfig
type serverConfig struct {
- Container string `yaml:"container"`
- Image string `yaml:"image"`
+ Container string `yaml:"container"`
+ Image string `yaml:"image"`
+ Profiles []string `yaml:"profiles"`
Feedback bool `yaml:"feedback"`
FeedbackTimeout int `yaml:"feedback_timeout"`
diff --git a/rest.go b/rest.go
index c010631..6d3ca77 100644
--- a/rest.go
+++ b/rest.go
@@ -362,9 +362,9 @@ users:
var resp *api.Response
if config.Container != "" {
- resp, err = lxdDaemon.LocalCopy(config.Container, containerName, ctConfig, nil, \
false) + resp, err = lxdDaemon.LocalCopy(config.Container, containerName, ctConfig, \
config.Profiles, false) } else {
- resp, err = lxdDaemon.Init(containerName, "local", config.Image, nil, ctConfig, \
nil, false) + resp, err = lxdDaemon.Init(containerName, "local", config.Image, \
&config.Profiles, ctConfig, nil, false) }
if err != nil {
[Attachment #4 (text/plain)]
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic