build/linux/installer/scripts/tomlparser-health-config.rb
# Use parser to parse the configmap toml file to a ruby structure
Use parser to parse the configmap toml file to a ruby structure
Use parser to parse the configmap toml file to a ruby structure
def parseConfigMap
  begin
    if (File.file?(@configMapMountPath))
      puts "config::configmap container-azm-ms-agentconfig for agent health settings mounted, parsing values"
      parsedConfig = Tomlrb.load_file(@configMapMountPath, symbolize_keys: true)
      puts "config::Successfully parsed mounted config map"
      return parsedConfig
    else
      puts "config::configmap container-azm-ms-agentconfig for agent health settings not mounted, using defaults"
      return nil
    end
  rescue => errorStr
    ConfigParseErrorLogger.logError("Exception while parsing config map for enabling health: #{errorStr}, using defaults, please check config map for errors")
    return nil
  end
end
def parseConfigMap begin if ( File . file? ( @configMapMountPath ) ) puts "config::configmap container-azm-ms-agentconfig for agent health settings mounted, parsing values" parsedConfig = Tomlrb . load_file ( @configMapMountPath , symbolize_keys : true ) puts "config::Successfully parsed mounted config map" return parsedConfig else puts "config::configmap container-azm-ms-agentconfig for agent health settings not mounted, using defaults" return nil end rescue => errorStr ConfigParseErrorLogger . logError ( "Exception while parsing config map for enabling health: #{errorStr}, using defaults, please check config map for errors" ) return nil end end
Use parser to parse the configmap toml file to a ruby structure
Use parser to parse the configmap toml file to a ruby structure
# Check to see if config map is created