func applyConfig(ccf *CLIConfig, cfg *service.Config) error {
	// load /etc/teleport.yaml and apply it's values:
	fileConf, err := config.ReadConfigFile(ccf.ConfigFile)
	if err != nil {
		return trace.Wrap(err)
	}
	// if configuration is passed as an environment variable,
	// try to decode it and override the config file
	if ccf.ConfigString != "" {
		fileConf, err = config.ReadFromString(ccf.ConfigString)
		if err != nil {
			return trace.Wrap(err)
		}
	}
	if err = config.ApplyFileConfig(fileConf, cfg); err != nil {
		return trace.Wrap(err)
	}
	// --debug flag
	if ccf.Debug {
		utils.InitLoggerDebug()
		logrus.Debugf("DEBUG loggign enabled")
	}
	return nil
}
// applyConfig takes configuration values from the config file and applies
// them to 'service.Config' object
applyConfig takes configuration values from the config file and applies
them to 'service.Config' object
// applyConfig takes configuration values from the config file and applies // them to ' service . Config ' object
func applyConfig(ccf *CLIConfig, cfg *service.Config) error {
	fileConf, err := config.ReadConfigFile(ccf.ConfigFile)
	if err != nil {
		return trace.Wrap(err)
	}
	if ccf.ConfigString != "" {
		fileConf, err = config.ReadFromString(ccf.ConfigString)
		if err != nil {
			return trace.Wrap(err)
		}
	}
	if err = config.ApplyFileConfig(fileConf, cfg); err != nil {
		return trace.Wrap(err)
	}
	if ccf.Debug {
		utils.InitLoggerDebug()
		logrus.Debugf("DEBUG loggign enabled")
	}
	return nil
}
func applyConfig ( ccf * CLIConfig , cfg * service . Config ) error { fileConf , err := config . ReadConfigFile ( ccf . ConfigFile ) if err != nil { return trace . Wrap ( err ) } if ccf . ConfigString != " " { fileConf , err = config . ReadFromString ( ccf . ConfigString ) if err != nil { return trace . Wrap ( err ) } } if err = config . ApplyFileConfig ( fileConf , cfg ) ; err != nil { return trace . Wrap ( err ) } if ccf . Debug { utils . InitLoggerDebug ( ) logrus . Debugf ( " " ) } return nil }
applyConfig takes configuration values from the config file and applies
them to 'service.Config' object
applyConfig takes configuration values from the config file and applies them to ' service . Config ' object
// load /etc/teleport.yaml and apply it's values: // if configuration is passed as an environment variable, // try to decode it and override the config file // --debug flag