MCPcopy Create free account
hub / github.com/cloudbase/garm / initConfig

Function initConfig

cmd/garm-cli/cmd/root.go:111–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

109}
110
111func initConfig() {
112 var err error
113 cfg, err = config.LoadConfig()
114 if err != nil {
115 fmt.Printf("Failed to load config: %s", err)
116 os.Exit(1)
117 }
118 if len(cfg.Managers) == 0 {
119 // config is empty.
120 needsInit = true
121 } else {
122 mgr, err = cfg.GetActiveConfig()
123 if err != nil {
124 mgr = cfg.Managers[0]
125 }
126 }
127 initAPIClient(mgr.BaseURL, mgr.Token)
128}
129
130func formatOneHookInfo(hook params.HookInfo) {
131 t := table.NewWriter()

Callers

nothing calls this directly

Calls 3

LoadConfigFunction · 0.92
initAPIClientFunction · 0.85
GetActiveConfigMethod · 0.80

Tested by

no test coverage detected