Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Fix #1499 update explaination to auto-discovery plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
nanliu committed Feb 7, 2017
1 parent b7c4674 commit d037dc0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
16 changes: 8 additions & 8 deletions control/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ func TestControlConfigJSON(t *testing.T) {
Convey("An error should not be returned when unmarshalling the config", func() {
So(err, ShouldBeNil)
})
Convey("AutoDiscoverPath should be set to /some/directory/with/plugins", func() {
So(cfg.AutoDiscoverPath, ShouldEqual, "/some/directory/with/plugins")
Convey("AutoDiscoverPath should be set to /opt/snap/plugins:/opt/snap/tasks", func() {
So(cfg.AutoDiscoverPath, ShouldEqual, "/opt/snap/plugins:/opt/snap/tasks")
})
Convey("CacheExpiration should be set to 750ms", func() {
So(cfg.CacheExpiration.Duration, ShouldResemble, 750*time.Millisecond)
Expand All @@ -178,8 +178,8 @@ func TestControlConfigJSON(t *testing.T) {
Convey("ListenPort should be set to 10082", func() {
So(cfg.ListenPort, ShouldEqual, 10082)
})
Convey("KeyringPaths should be set to /some/path/with/keyring/files", func() {
So(cfg.KeyringPaths, ShouldEqual, "/some/path/with/keyring/files")
Convey("KeyringPaths should be set to /etc/snap/keyrings", func() {
So(cfg.KeyringPaths, ShouldEqual, "/etc/snap/keyrings")
})
Convey("PluginTrust should be set to 0", func() {
So(cfg.PluginTrust, ShouldEqual, 0)
Expand Down Expand Up @@ -233,8 +233,8 @@ func TestControlConfigYaml(t *testing.T) {
Convey("An error should not be returned when unmarshalling the config", func() {
So(err, ShouldBeNil)
})
Convey("AutoDiscoverPath should be set to /some/directory/with/plugins", func() {
So(cfg.AutoDiscoverPath, ShouldEqual, "/some/directory/with/plugins")
Convey("AutoDiscoverPath should be set to /opt/snap/plugins:/opt/snap/tasks", func() {
So(cfg.AutoDiscoverPath, ShouldEqual, "/opt/snap/plugins:/opt/snap/tasks")
})
Convey("CacheExpiration should be set to 750ms", func() {
So(cfg.CacheExpiration.Duration, ShouldResemble, 750*time.Millisecond)
Expand All @@ -251,8 +251,8 @@ func TestControlConfigYaml(t *testing.T) {
Convey("ListenPort should be set to 10082", func() {
So(cfg.ListenPort, ShouldEqual, 10082)
})
Convey("KeyringPaths should be set to /some/path/with/keyring/files", func() {
So(cfg.KeyringPaths, ShouldEqual, "/some/path/with/keyring/files")
Convey("KeyringPaths should be set to /etc/snap/keyrings", func() {
So(cfg.KeyringPaths, ShouldEqual, "/etc/snap/keyrings")
})
Convey("PluginTrust should be set to 0", func() {
So(cfg.PluginTrust, ShouldEqual, 0)
Expand Down
6 changes: 3 additions & 3 deletions docs/SNAPTELD_CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ The control section contains settings for configuring the Control module within

```yaml
control:
# auto_discover_path sets a directory to auto load plugins on the start
# of the Snap daemon
auto_discover_path: /opt/snap/plugins
# auto_discover_path sets the directory(s) to auto load plugins and tasks on
# the start of the snap daemon. This can be a comma separated list of directories.
auto_discover_path: /opt/snap/plugins:/opt/snap/tasks

# cache_expiration sets the time interval for the plugin cache to use before
# expiring collection results from collect plugins. Default value is 500ms
Expand Down
10 changes: 5 additions & 5 deletions examples/configs/snap-config-sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"log_colors":true,
"gomaxprocs":2,
"control":{
"auto_discover_path":"/some/directory/with/plugins",
"auto_discover_path":"/opt/snap/plugins:/opt/snap/tasks",
"max_plugin_restarts":10,
"cache_expiration":"750ms",
"listen_addr":"0.0.0.0",
"listen_port":10082,
"max_running_plugins":1,
"plugin_load_timeout":10,
"keyring_paths":"/some/path/with/keyring/files",
"keyring_paths":"/etc/snap/keyrings",
"plugin_trust_level":0,
"plugins":{
"all":{
Expand Down Expand Up @@ -81,8 +81,8 @@
"https":true,
"rest_auth":true,
"rest_auth_password":"changeme",
"rest_certificate":"/path/to/cert/file",
"rest_key":"/path/to/private/key",
"rest_certificate":"/etc/snap/cert.pem",
"rest_key":"/etc/snap/cert.key",
"port":8282,
"addr":"127.0.0.1:12345"
},
Expand All @@ -93,4 +93,4 @@
"name":"localhost",
"seed":"1.1.1.1:16000"
}
}
}
14 changes: 7 additions & 7 deletions examples/configs/snap-config-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ log_level: 2
# default snapteld prints all logs to stdout. Any provided
# path will send snapteld logs to a file called snapteld.log in
# the provided directory.
log_path: /some/log/dir
log_path: /var/log/snap

# log_truncate specifies how the log file with be opened
# false => append
Expand All @@ -27,9 +27,9 @@ gomaxprocs: 2
# Control sections for configuration settings for the plugin
# control module of snapteld.
control:
# auto_discover_path sets a directory to auto load plugins on the start
# of the snap daemon
auto_discover_path: /some/directory/with/plugins
# auto_discover_path sets the directory(s) to auto load plugins and tasks on
# the start of the snap daemon. This can be a comma separated list of directories.
auto_discover_path: /opt/snap/plugins:/opt/snap/tasks

# cache_expiration sets the time interval for the plugin cache to use before
# expiring collection results from collect plugins. Default value is 500ms
Expand All @@ -53,7 +53,7 @@ control:

# keyring_paths sets the directory(s) to search for keyring files for signed
# plugins. This can be a comma separated list of directories
keyring_paths: /some/path/with/keyring/files
keyring_paths: /etc/snap/keyrings

# plugin_trust_level sets the plugin trust level for snapteld. The default state
# for plugin trust level is enabled (1). When enabled, only signed plugins that can
Expand Down Expand Up @@ -141,11 +141,11 @@ restapi:
rest_auth_password: changeme

# rest_certificate is the path to the certificate to use for REST API when HTTPS is also enabled.
rest_certificate: /path/to/cert/file
rest_certificate: /etc/snap/cert.pem

# rest_key is the path to the private key for the certificate in use by the REST API
# when HTTPs is enabled.
rest_key: /path/to/private/key
rest_key: /etc/snap/cert.key

# port sets the port to start the REST API server on. Default is 8181
port: 8282
Expand Down
16 changes: 8 additions & 8 deletions mgmt/rest/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ func TestRestAPIConfigJSON(t *testing.T) {
Convey("RestAuthPassword should equal changeme", func() {
So(cfg.RestAuthPassword, ShouldEqual, "changeme")
})
Convey("RestCertificate should equal /path/to/cert/file", func() {
So(cfg.RestCertificate, ShouldEqual, "/path/to/cert/file")
Convey("RestCertificate should equal /etc/snap/cert.pem", func() {
So(cfg.RestCertificate, ShouldEqual, "/etc/snap/cert.pem")
})
Convey("RestKey should equal /path/to/private/key", func() {
So(cfg.RestKey, ShouldEqual, "/path/to/private/key")
Convey("RestKey should equal /etc/snap/cert.key", func() {
So(cfg.RestKey, ShouldEqual, "/etc/snap/cert.key")
})
})

Expand Down Expand Up @@ -124,11 +124,11 @@ func TestRestAPIConfigYaml(t *testing.T) {
Convey("RestAuthPassword should equal changeme", func() {
So(cfg.RestAuthPassword, ShouldEqual, "changeme")
})
Convey("RestCertificate should equal /path/to/cert/file", func() {
So(cfg.RestCertificate, ShouldEqual, "/path/to/cert/file")
Convey("RestCertificate should equal /etc/snap/cert.pem", func() {
So(cfg.RestCertificate, ShouldEqual, "/etc/snap/cert.pem")
})
Convey("RestKey should equal /path/to/private/key", func() {
So(cfg.RestKey, ShouldEqual, "/path/to/private/key")
Convey("RestKey should equal /etc/snap/cert.key", func() {
So(cfg.RestKey, ShouldEqual, "/etc/snap/cert.key")
})
})

Expand Down

0 comments on commit d037dc0

Please sign in to comment.