Documentation ¶
Overview ¶
Package cfg is package responsible to loading and accessing the guest environment configuration.
Index ¶
- func Load(extraDefaults []byte) error
- type AccountManager
- type Accounts
- type AddressManager
- type Core
- type Daemons
- type Diagnostics
- type IPForwarding
- type Instance
- type InstanceSetup
- type MDS
- type MetadataScripts
- type NetworkInterfaces
- type OSLogin
- type Sections
- type Snapshots
- type Unstable
- type WSFC
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountManager ¶
type AccountManager struct {
Disable bool `ini:"disable,omitempty"`
}
AccountManager contains the configurations of AccountManager section.
type Accounts ¶
type Accounts struct { DeprovisionRemove bool `ini:"deprovision_remove,omitempty"` GPasswdAddCmd string `ini:"gpasswd_add_cmd,omitempty"` GPasswdRemoveCmd string `ini:"gpasswd_remove_cmd,omitempty"` GroupAddCmd string `ini:"groupadd_cmd,omitempty"` Groups string `ini:"groups,omitempty"` ReuseHomedir bool `ini:"reuse_homedir,omitempty"` UserAddCmd string `ini:"useradd_cmd,omitempty"` UserDelCmd string `ini:"userdel_cmd,omitempty"` }
Accounts contains the configurations of Accounts section.
type AddressManager ¶
type AddressManager struct {
Disable bool `ini:"disable,omitempty"`
}
AddressManager contains the configuration of addressManager section.
type Core ¶
type Core struct { // CloudLoggingEnabled config toggle controls Guest Agent cloud logger. // Disabling it will stop Guest Agent for configuring and logging to Cloud Logging. CloudLoggingEnabled bool `ini:"cloud_logging_enabled,omitempty"` }
Core contains the core configuration entries of guest agent, all configurations not tied/specific to a subsystem are defined in here.
type Daemons ¶
type Daemons struct { AccountsDaemon bool `ini:"accounts_daemon,omitempty"` ClockSkewDaemon bool `ini:"clock_skew_daemon,omitempty"` NetworkDaemon bool `ini:"network_daemon,omitempty"` }
Daemons contains the configurations of Daemons section.
type Diagnostics ¶
type Diagnostics struct {
Enable bool `ini:"enable,omitempty"`
}
Diagnostics contains the configurations of Diagnostics section.
type IPForwarding ¶
type IPForwarding struct { EthernetProtoID string `ini:"ethernet_proto_id,omitempty"` IPAliases bool `ini:"ip_aliases,omitempty"` TargetInstanceIPs bool `ini:"target_instance_ips,omitempty"` }
IPForwarding contains the configurations of IPForwarding section.
type Instance ¶
type Instance struct { // InstanceID is a backward compatible key. In the past the instance id was only // supported/setup via config file, if we can't read the instance_id file then // try honoring this configuration key. InstanceID string `ini:"instance_id,omitempty"` // InstanceIDDir defines where the instance id file should be read from. InstanceIDDir string `ini:"instance_id_dir,omitempty"` }
Instance contains the configurations of Instance section.
type InstanceSetup ¶
type InstanceSetup struct { HostKeyDir string `ini:"host_key_dir,omitempty"` HostKeyTypes string `ini:"host_key_types,omitempty"` NetworkEnabled bool `ini:"network_enabled,omitempty"` OptimizeLocalSSD bool `ini:"optimize_local_ssd,omitempty"` SetBotoConfig bool `ini:"set_boto_config,omitempty"` SetHostKeys bool `ini:"set_host_keys,omitempty"` SetMultiqueue bool `ini:"set_multiqueue,omitempty"` }
InstanceSetup contains the configurations of InstanceSetup section.
type MDS ¶
type MDS struct { // DisableHTTPSMdsSetup enables/disables the mTLS credential refresher. DisableHTTPSMdsSetup bool `ini:"disable-https-mds-setup,omitempty"` // HTTPSMDSEnableNativeStore enables/disables the use of OSs native store. Native // store is Certificate Store on Windows which hosts both Client Credential and // Root certificate where as its trust store that hosts root certs like // `/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem` on Linux. HTTPSMDSEnableNativeStore bool `ini:"enable-https-mds-native-cert-store,omitempty"` }
MDS contains the configurations for MDS section. Currently its opt-in only and should not assume any defaults. Setting any [defaultConfig] values will override user settings from Metadata.
type MetadataScripts ¶
type MetadataScripts struct { DefaultShell string `ini:"default_shell,omitempty"` RunDir string `ini:"run_dir,omitempty"` Shutdown bool `ini:"shutdown,omitempty"` ShutdownWindows bool `ini:"shutdown-windows,omitempty"` Startup bool `ini:"startup,omitempty"` StartupWindows bool `ini:"startup-windows,omitempty"` SysprepSpecialize bool `ini:"sysprep_specialize,omitempty"` }
MetadataScripts contains the configurations of MetadataScripts section.
type NetworkInterfaces ¶
type NetworkInterfaces struct { DHCPCommand string `ini:"dhcp_command,omitempty"` IPForwarding bool `ini:"ip_forwarding,omitempty"` Setup bool `ini:"setup,omitempty"` ManagePrimaryNIC bool `ini:"manage_primary_nic,omitempty"` RestoreDebian12NetplanConfig bool `ini:"restore_debian12_netplan_config,omitempty"` }
NetworkInterfaces contains the configurations of NetworkInterfaces section.
type OSLogin ¶
type OSLogin struct {
CertAuthentication bool `ini:"cert_authentication,omitempty"`
}
OSLogin contains the configurations of OSLogin section.
type Sections ¶
type Sections struct { // Core defines the core guest-agent's configuration entries/keys. Core *Core `ini:"Core,omitempty"` // AccountManager defines the address management configurations. It takes precedence over instance's // and project's metadata configuration. The default configuration doesn't define values to it, if the // user has defined it then we shouldn't even consider metadata values. Users must check if this // pointer is nil or not. AccountManager *AccountManager `ini:"accountManager,omitempty"` // Accounts defines the non windows account management options, behaviors and commands. Accounts *Accounts `ini:"Accounts,omitempty"` // AddressManager defines the address management configurations. It takes precedence over instance's // and project's metadata configuration. The default configuration doesn't define values to it, if the // user has defined it then we shouldn't even consider metadata values. Users must check if this // pointer is nil or not. AddressManager *AddressManager `ini:"addressManager,omitempty"` // Daemons defines the availability of clock skew, network and account managers. Daemons *Daemons `ini:"Daemons,omitempty"` // Diagnostics defines the diagnostics configurations. It takes precedence over instance's // and project's metadata configuration. The default configuration doesn't define values to it, if the // user has defined it then we shouldn't even consider metadata values. Users must check if this // pointer is nil or not. Diagnostics *Diagnostics `ini:"diagnostics,omitempty"` // IPForwarding defines the ip forwarding configuration options. IPForwarding *IPForwarding `ini:"IpForwarding,omitempty"` // Instance defines the instance ID handling behaviors, i.e. where to read the ID from etc. Instance *Instance `ini:"Instance,omitempty"` // InstanceSetup defines options to basic instance setup options i.e. optimize local ssd, network, // host keys etc. InstanceSetup *InstanceSetup `ini:"InstanceSetup,omitempty"` // MetadataScripts contains the configurations of the metadata-scripts service. MetadataScripts *MetadataScripts `ini:"MetadataScripts,omitempty"` // NetworkInterfaces defines if the network interfaces should be managed/configured by guest-agent // as well as the commands definitions for network configuration. NetworkInterfaces *NetworkInterfaces `ini:"NetworkInterfaces,omitempty"` // OSLogin defines the OS Login configuration options. OSLogin *OSLogin `ini:"OSLogin,omitempty"` // MDS defines the MDS configuration options. MDS *MDS `ini:"MDS,omitempty"` // Snpashots defines the snapshot listener configuration and behavior i.e. the server address and port. Snapshots *Snapshots `ini:"Snapshots,omitempty"` // Unstable is a "under development feature flags" section. No stability or long term support is // guaranteed for any keys under this section. No application, script or utility should rely on it. Unstable *Unstable `ini:"Unstable,omitempty"` // WSFC defines the wsfc configurations. It takes precedence over instance's and project's // metadata configuration. The default configuration doesn't define values to it, if the user // has defined it then we shouldn't even consider metadata values. Users must check if this // pointer is nil or not. WSFC *WSFC `ini:"wsfc,omitempty"` }
Sections encapsulates all the configuration sections.
type Snapshots ¶
type Snapshots struct { Enabled bool `ini:"enabled,omitempty"` SnapshotServiceIP string `ini:"snapshot_service_ip,omitempty"` SnapshotServicePort int `ini:"snapshot_service_port,omitempty"` TimeoutInSeconds int `ini:"timeout_in_seconds,omitempty"` }
Snapshots contains the configurations of Snapshots section.
type Unstable ¶
type Unstable struct { CommandMonitorEnabled bool `ini:"command_monitor_enabled,omitempty"` CommandPipePath string `ini:"command_pipe_path,omitempty"` CommandRequestTimeout string `ini:"command_request_timeout,omitempty"` CommandPipeMode string `ini:"command_pipe_mode,omitempty"` CommandPipeGroup string `ini:"command_pipe_group,omitempty"` VlanSetupEnabled bool `ini:"vlan_setup_enabled,omitempty"` SystemdConfigDir string `ini:"systemd_config_dir,omitempty"` }
Unstable contains the configurations of Unstable section. No long term stability or support is guaranteed for configurations defined in the Unstable section. By default all flags defined in this section is disabled and is intended to isolate under development features.