Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CheckCommand checkCommand
var DefaultYAML []byte
var DumpCommand dumpCommand
var DumpDefaultsCommand defaultsCommand
Functions ¶
func ExportJSON ¶
ExportJSON writes a JSON object with the safe (non-secret) portions of the cluster config to w.
Types ¶
type Loader ¶
type Loader struct { Stdin io.Reader Logger logrus.FieldLogger SkipDeprecated bool // Don't load deprecated config keys SkipLegacy bool // Don't load legacy config files SkipAPICalls bool // Don't do checks that call RailsAPI/controller Path string KeepstorePath string KeepWebPath string CrunchDispatchSlurmPath string WebsocketPath string KeepproxyPath string KeepBalancePath string // contains filtered or unexported fields }
func NewLoader ¶
func NewLoader(stdin io.Reader, logger logrus.FieldLogger) *Loader
NewLoader returns a new Loader with Stdin and Logger set to the given values, and all config paths set to their default values.
func (*Loader) MungeLegacyConfigArgs ¶
func (ldr *Loader) MungeLegacyConfigArgs(lgr logrus.FieldLogger, args []string, legacyConfigArg string) []string
MungeLegacyConfigArgs checks args for a -config flag whose argument is a regular file (or a symlink to one), but doesn't have a top-level "Clusters" key and therefore isn't a valid cluster configuration file. If it finds such a flag, it replaces -config with legacyConfigArg (e.g., "-legacy-keepstore-config").
This is used by programs that still need to accept "-config" as a way to specify a per-component config file until their config has been migrated.
If any errors are encountered while reading or parsing a config file, the given args are not munged. We presume the same errors will be encountered again and reported later on when trying to load cluster configuration from the same file, regardless of which struct we end up using.
func (*Loader) RegisterMetrics ¶
func (ldr *Loader) RegisterMetrics(reg *prometheus.Registry)
RegisterMetrics registers metrics showing the timestamp and content hash of the currently loaded config.
Must not be called more than once for a given registry. Must not be called before Load(). Metrics are not updated by subsequent calls to Load().
func (*Loader) SetupFlags ¶
SetupFlags configures a flagset so arguments like -config X can be used to change the loader's Path fields.
ldr := NewLoader(os.Stdin, logrus.New()) flagset := flag.NewFlagSet("", flag.ContinueOnError) ldr.SetupFlags(flagset) // ldr.Path == "/etc/arvados/config.yml" flagset.Parse([]string{"-config", "/tmp/c.yaml"}) // ldr.Path == "/tmp/c.yaml"