Skip to content

Commit

Permalink
Merge pull request #1576 from Ace-Tang/net_priority
Browse files Browse the repository at this point in the history
feature: support net priority flag
  • Loading branch information
rudyfly authored Jul 9, 2018
2 parents 3ab7f40 + 8869011 commit f3c247c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apis/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1964,6 +1964,10 @@ definitions:
QuotaID:
type: "string"
description: "set disk quota by specified quota id, if id < 0, it means pouchd alloc a unique quota id"
NetPriority:
description: "net priority."
type: "integer"
default: 0

ContainerCreateResp:
description: "response returned by daemon when container create successfully"
Expand Down
5 changes: 5 additions & 0 deletions apis/types/container_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cli/common_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func addCommonFlags(flagSet *pflag.FlagSet) *container {
flagSet.StringVar(&c.richMode, "rich-mode", "", "Choose one rich container mode. dumb-init(default), systemd, sbin-init")
flagSet.StringVar(&c.initScript, "initscript", "", "Initial script executed in container")
flagSet.StringVar(&c.shmSize, "shm-size", "", "Size of /dev/shm, default value is 64MB")
flagSet.Int64Var(&c.netPriority, "net-priority", 0, "net priority")

// cgroup
flagSet.StringVarP(&c.cgroupParent, "cgroup-parent", "", "", "Optional parent cgroup for the container")
Expand Down
2 changes: 2 additions & 0 deletions cli/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ type container struct {
ulimit config.Ulimit
pidsLimit int64
shmSize string
netPriority int64

// log driver and log option
logDriver string
Expand Down Expand Up @@ -204,6 +205,7 @@ func (c *container) config() (*types.ContainerCreateConfig, error) {
DiskQuota: diskQuota,
QuotaID: c.quotaID,
SpecAnnotation: specAnnotation,
NetPriority: c.netPriority,
},

HostConfig: &types.HostConfig{
Expand Down

0 comments on commit f3c247c

Please sign in to comment.