-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: support configuring default log driver in plugin options
- Loading branch information
Showing
5 changed files
with
65 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,6 +206,18 @@ var ( | |
// extra docker labels, globs supported | ||
"extra_labels": hclspec.NewAttr("extra_labels", "list(string)", false), | ||
|
||
// logging options | ||
"logging": hclspec.NewDefault(hclspec.NewBlock("logging", false, hclspec.NewObject(map[string]*hclspec.Spec{ | ||
"type": hclspec.NewAttr("type", "string", false), | ||
"config": hclspec.NewBlockAttrs("config", "string", false), | ||
})), hclspec.NewLiteral(`{ | ||
type = "json-file" | ||
config = { | ||
max-file = "2" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
tgross
Member
|
||
max-size = "2m" | ||
} | ||
}`)), | ||
|
||
// garbage collection options | ||
// default needed for both if the gc {...} block is not set and | ||
// if the default fields are missing | ||
|
@@ -616,6 +628,7 @@ type DriverConfig struct { | |
PullActivityTimeout string `codec:"pull_activity_timeout"` | ||
pullActivityTimeoutDuration time.Duration `codec:"-"` | ||
ExtraLabels []string `codec:"extra_labels"` | ||
Logging LoggingConfig `codec:"logging"` | ||
|
||
AllowRuntimesList []string `codec:"allow_runtimes"` | ||
allowRuntimes map[string]struct{} `codec:"-"` | ||
|
@@ -646,6 +659,11 @@ type VolumeConfig struct { | |
SelinuxLabel string `codec:"selinuxlabel"` | ||
} | ||
|
||
type LoggingConfig struct { | ||
Type string `codec:"type"` | ||
Config map[string]string `codec:"config"` | ||
} | ||
|
||
func (d *Driver) PluginInfo() (*base.PluginInfoResponse, error) { | ||
return pluginInfo, nil | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use defaults of 10 and 10m here?