Skip to content

Commit

Permalink
node-installer: omit writing empty containerd config values
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Meyer <[email protected]>
  • Loading branch information
katexochen committed Aug 9, 2024
1 parent 03a81b3 commit 92276e0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 41 deletions.
34 changes: 17 additions & 17 deletions nodeinstaller/internal/config/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,41 @@ type ContainerdConfig struct {
// Version of the config file
Version int `toml:"version"`
// Root is the path to a directory where containerd will store persistent data
Root string `toml:"root"`
Root string `toml:"root,omitempty"`
// State is the path to a directory where containerd will store transient data
State string `toml:"state"`
State string `toml:"state,omitempty"`
// TempDir is the path to a directory where to place containerd temporary files
TempDir string `toml:"temp"`
TempDir string `toml:"temp,omitempty"`
// PluginDir is the directory for dynamic plugins to be stored
PluginDir string `toml:"plugin_dir"`
PluginDir string `toml:"plugin_dir,omitempty"`
// GRPC configuration settings
GRPC any `toml:"grpc"`
GRPC any `toml:"grpc,omitempty"`
// TTRPC configuration settings
TTRPC any `toml:"ttrpc"`
TTRPC any `toml:"ttrpc,omitempty"`
// Debug and profiling settings
Debug any `toml:"debug"`
Debug any `toml:"debug,omitempty"`
// Metrics and monitoring settings
Metrics any `toml:"metrics"`
Metrics any `toml:"metrics,omitempty"`
// DisabledPlugins are IDs of plugins to disable. Disabled plugins won't be
// initialized and started.
DisabledPlugins []string `toml:"disabled_plugins"`
DisabledPlugins []string `toml:"disabled_plugins,omitempty"`
// RequiredPlugins are IDs of required plugins. Containerd exits if any
// required plugin doesn't exist or fails to be initialized or started.
RequiredPlugins []string `toml:"required_plugins"`
RequiredPlugins []string `toml:"required_plugins,omitempty"`
// Plugins provides plugin specific configuration for the initialization of a plugin
Plugins map[string]any `toml:"plugins"`
Plugins map[string]any `toml:"plugins,omitempty"`
// OOMScore adjust the containerd's oom score
OOMScore int `toml:"oom_score"`
OOMScore int `toml:"oom_score,omitempty"`
// Cgroup specifies cgroup information for the containerd daemon process
Cgroup any `toml:"cgroup"`
Cgroup any `toml:"cgroup,omitempty"`
// ProxyPlugins configures plugins which are communicated to over GRPC
ProxyPlugins map[string]ProxyPlugin `toml:"proxy_plugins"`
ProxyPlugins map[string]ProxyPlugin `toml:"proxy_plugins,omitempty"`
// Timeouts specified as a duration
Timeouts map[string]string `toml:"timeouts"`
Timeouts map[string]string `toml:"timeouts,omitempty"`
// Imports are additional file path list to config files that can overwrite main config file fields
Imports []string `toml:"imports"`
Imports []string `toml:"imports,omitempty"`
// StreamProcessors configuration
StreamProcessors map[string]any `toml:"stream_processors"`
StreamProcessors map[string]any `toml:"stream_processors,omitempty"`
}

// ProxyPlugin provides a proxy plugin configuration.
Expand Down
8 changes: 0 additions & 8 deletions nodeinstaller/testdata/expected-aks-clh-snp.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
version = 2
root = ''
state = ''
temp = ''
plugin_dir = ''
disabled_plugins = []
required_plugins = []
oom_score = 0
imports = []

[metrics]
address = '0.0.0.0:10257'
Expand Down
8 changes: 0 additions & 8 deletions nodeinstaller/testdata/expected-bare-metal-qemu-snp.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
version = 2
root = ''
state = ''
temp = ''
plugin_dir = ''
disabled_plugins = []
required_plugins = []
oom_score = 0
imports = []

[metrics]
address = '0.0.0.0:10257'
Expand Down
8 changes: 0 additions & 8 deletions nodeinstaller/testdata/expected-bare-metal-qemu-tdx.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
version = 2
root = ''
state = ''
temp = ''
plugin_dir = ''
disabled_plugins = []
required_plugins = []
oom_score = 0
imports = []

[metrics]
address = '0.0.0.0:10257'
Expand Down

0 comments on commit 92276e0

Please sign in to comment.