Skip to content

Commit

Permalink
Rename netns-pool-size to cni-pool-size
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
  • Loading branch information
aaronlehmann committed Sep 14, 2022
1 parent 8c96330 commit f57dc7f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cmd/buildkitd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type NetworkConfig struct {
Mode string `toml:"networkMode"`
CNIConfigPath string `toml:"cniConfigPath"`
CNIBinaryPath string `toml:"cniBinaryPath"`
NetNSPoolSize int `toml:"netNSPoolSize"`
CNIPoolSize int `toml:"cniPoolSize"`
}

type OCIConfig struct {
Expand Down
12 changes: 6 additions & 6 deletions cmd/buildkitd/main_containerd_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ func init() {
Value: defaultConf.Workers.Containerd.NetworkConfig.CNIBinaryPath,
},
cli.IntFlag{
Name: "containerd-netns-pool-size",
Usage: "size of network namespace pool",
Value: defaultConf.Workers.Containerd.NetworkConfig.NetNSPoolSize,
Name: "containerd-cni-pool-size",
Usage: "size of cni network namespace pool",
Value: defaultConf.Workers.Containerd.NetworkConfig.CNIPoolSize,
},
cli.StringFlag{
Name: "containerd-worker-snapshotter",
Expand Down Expand Up @@ -213,8 +213,8 @@ func applyContainerdFlags(c *cli.Context, cfg *config.Config) error {
if c.GlobalIsSet("containerd-cni-config-path") {
cfg.Workers.Containerd.NetworkConfig.CNIConfigPath = c.GlobalString("containerd-cni-config-path")
}
if c.GlobalIsSet("containerd-netns-pool-size") {
cfg.Workers.Containerd.NetworkConfig.NetNSPoolSize = c.GlobalInt("containerd-netns-pool-size")
if c.GlobalIsSet("containerd-cni-pool-size") {
cfg.Workers.Containerd.NetworkConfig.CNIPoolSize = c.GlobalInt("containerd-cni-pool-size")
}
if c.GlobalIsSet("containerd-cni-binary-dir") {
cfg.Workers.Containerd.NetworkConfig.CNIBinaryPath = c.GlobalString("containerd-cni-binary-dir")
Expand Down Expand Up @@ -255,7 +255,7 @@ func containerdWorkerInitializer(c *cli.Context, common workerInitializerOpt) ([
Root: common.config.Root,
ConfigPath: common.config.Workers.Containerd.CNIConfigPath,
BinaryDir: common.config.Workers.Containerd.CNIBinaryPath,
PoolSize: common.config.Workers.Containerd.NetNSPoolSize,
PoolSize: common.config.Workers.Containerd.CNIPoolSize,
},
}

Expand Down
16 changes: 8 additions & 8 deletions cmd/buildkitd/main_oci_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ func init() {
Usage: "path of cni binary files",
Value: defaultConf.Workers.OCI.NetworkConfig.CNIBinaryPath,
},
cli.IntFlag{
Name: "oci-cni-pool-size",
Usage: "size of cni network namespace pool",
Value: defaultConf.Workers.OCI.NetworkConfig.CNIPoolSize,
},
cli.StringFlag{
Name: "oci-worker-binary",
Usage: "name of specified oci worker binary",
Value: defaultConf.Workers.OCI.Binary,
},
cli.IntFlag{
Name: "oci-netns-pool-size",
Usage: "size of network namespace pool",
Value: defaultConf.Workers.OCI.NetworkConfig.NetNSPoolSize,
},
cli.StringFlag{
Name: "oci-worker-apparmor-profile",
Usage: "set the name of the apparmor profile applied to containers",
Expand Down Expand Up @@ -228,8 +228,8 @@ func applyOCIFlags(c *cli.Context, cfg *config.Config) error {
if c.GlobalIsSet("oci-cni-binary-dir") {
cfg.Workers.OCI.NetworkConfig.CNIBinaryPath = c.GlobalString("oci-cni-binary-dir")
}
if c.GlobalIsSet("oci-netns-pool-size") {
cfg.Workers.OCI.NetworkConfig.NetNSPoolSize = c.GlobalInt("oci-netns-pool-size")
if c.GlobalIsSet("oci-cni-pool-size") {
cfg.Workers.OCI.NetworkConfig.CNIPoolSize = c.GlobalInt("oci-cni-pool-size")
}
if c.GlobalIsSet("oci-worker-binary") {
cfg.Workers.OCI.Binary = c.GlobalString("oci-worker-binary")
Expand Down Expand Up @@ -290,7 +290,7 @@ func ociWorkerInitializer(c *cli.Context, common workerInitializerOpt) ([]worker
Root: common.config.Root,
ConfigPath: common.config.Workers.OCI.CNIConfigPath,
BinaryDir: common.config.Workers.OCI.CNIBinaryPath,
PoolSize: common.config.Workers.OCI.NetNSPoolSize,
PoolSize: common.config.Workers.OCI.CNIPoolSize,
},
}

Expand Down
8 changes: 4 additions & 4 deletions docs/buildkitd.toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ insecure-entitlements = [ "network.host", "security.insecure" ]
apparmor-profile = ""
# limit the number of parallel build steps that can run at the same time
max-parallelism = 4
# maintain a pool of reusable network namespaces to amortize the overhead
# maintain a pool of reusable CNI network namespaces to amortize the overhead
# of allocating and releasing the namespaces
netNSPoolSize = 16
cniPoolSize = 16
[worker.oci.labels]
"foo" = "bar"
Expand All @@ -80,9 +80,9 @@ insecure-entitlements = [ "network.host", "security.insecure" ]
gc = true
# gckeepstorage sets storage limit for default gc profile, in MB.
gckeepstorage = 9000
# maintain a pool of reusable network namespaces to amortize the overhead
# maintain a pool of reusable CNI network namespaces to amortize the overhead
# of allocating and releasing the namespaces
netNSPoolSize = 16
cniPoolSize = 16
[worker.containerd.labels]
"foo" = "bar"
Expand Down

0 comments on commit f57dc7f

Please sign in to comment.