pub fn default_config(preferred_ip_family: &IpAddr) -> anyhow::Result<Self> {
        let hostname = default_hostname()?;
        let data_dir = default_data_dir()?;
        let cert_file = default_cert_path(&data_dir);
        let private_key_file = default_key_path(&data_dir);
        Ok(Config {
            node_ip: default_node_ip(&mut hostname.clone(), preferred_ip_family)?,
            node_name: sanitize_hostname(&hostname),
            node_labels: HashMap::new(),
            hostname,
            data_dir,
            max_pods: DEFAULT_MAX_PODS,
            bootstrap_file: PathBuf::from(BOOTSTRAP_FILE),
            allow_local_modules: false,
            insecure_registries: None,
            server_config: ServerConfig {
                addr: match preferred_ip_family {
                    IpAddr::V4(_) => IpAddr::V4(Ipv4Addr::UNSPECIFIED),
                    IpAddr::V6(_) => IpAddr::V6(Ipv6Addr::UNSPECIFIED),
                },
                port: DEFAULT_PORT,
                cert_file,
                private_key_file,
            },
        })
    }
/// Returns a Config object set with all of the defaults.
///
/// Useful for cases when you don't want to set most of the values yourself. The
/// preferred_ip_family argument takes an IpAddr that is either V4 or V6 to
/// indicate the preferred IP family to use for defaults
Returns a Config object set with all of the defaults.
Useful for cases when you don't want to set most of the values yourself. The
preferred_ip_family argument takes an IpAddr that is either V4 or V6 to
indicate the preferred IP family to use for defaults
Returns a Config object set with all of the defaults . Useful for cases when you don ' t want to set most of the values yourself . The preferred_ip_family argument takes an IpAddr that is either V4 or V6 to indicate the preferred IP family to use for defaults
pub fn default_config(preferred_ip_family: &IpAddr) -> anyhow::Result<Self> {
        let hostname = default_hostname()?;
        let data_dir = default_data_dir()?;
        let cert_file = default_cert_path(&data_dir);
        let private_key_file = default_key_path(&data_dir);
        Ok(Config {
            node_ip: default_node_ip(&mut hostname.clone(), preferred_ip_family)?,
            node_name: sanitize_hostname(&hostname),
            node_labels: HashMap::new(),
            hostname,
            data_dir,
            max_pods: DEFAULT_MAX_PODS,
            bootstrap_file: PathBuf::from(BOOTSTRAP_FILE),
            allow_local_modules: false,
            insecure_registries: None,
            server_config: ServerConfig {
                addr: match preferred_ip_family {
                    IpAddr::V4(_) => IpAddr::V4(Ipv4Addr::UNSPECIFIED),
                    IpAddr::V6(_) => IpAddr::V6(Ipv6Addr::UNSPECIFIED),
                },
                port: DEFAULT_PORT,
                cert_file,
                private_key_file,
            },
        })
    }
pub fn default_config ( preferred_ip_family : & IpAddr ) -> anyhow :: Result < Self > { let hostname = default_hostname ( ) ? ; let data_dir = default_data_dir ( ) ? ; let cert_file = default_cert_path ( & data_dir ) ; let private_key_file = default_key_path ( & data_dir ) ; Ok ( Config { node_ip : default_node_ip ( & mut hostname . clone ( ) , preferred_ip_family ) ? , node_name : sanitize_hostname ( & hostname ) , node_labels : HashMap :: new ( ) , hostname , data_dir , max_pods : DEFAULT_MAX_PODS , bootstrap_file : PathBuf :: from ( BOOTSTRAP_FILE ) , allow_local_modules : false , insecure_registries : None , server_config : ServerConfig { addr : match preferred_ip_family { IpAddr :: V4 ( _ ) => IpAddr :: V4 ( Ipv4Addr :: UNSPECIFIED ) , IpAddr :: V6 ( _ ) => IpAddr :: V6 ( Ipv6Addr :: UNSPECIFIED ) , } , port : DEFAULT_PORT , cert_file , private_key_file , } , } ) }
Returns a Config object set with all of the defaults.
Returns a Config object set with all of the defaults .
preferred_ip_family
&IpAddr
preferred_ip_family
&IpAddr