MCPcopy Create free account
hub / github.com/buildkite/agent-stack-k8s / Run

Function Run

cmd/controller/controller.go:42–65  ·  view source on GitHub ↗

Run is the main entry point for the controller.

()

Source from the content-addressed store, hash-verified

40
41// Run is the main entry point for the controller.
42func Run() error {
43 // Check if first arg is a subcommand
44 if len(os.Args) > 1 {
45 switch os.Args[1] {
46 case "lint":
47 return linter.Run()
48 case "version":
49 return version.Run()
50 }
51 }
52
53 cfg, err := BuildConfigFromArgs(os.Args[1:])
54 if err != nil {
55 var errs validator.ValidationErrors
56 if errors.As(err, &errs) {
57 for _, e := range errs {
58 log.Println(e.Translate(trans))
59 }
60 }
61 return err
62 }
63
64 return runController(cfg)
65}
66
67// BuildConfigFromArgs parses CLI args and env vars, then builds config.
68// Config file can be specified via --config flag or CONFIG env var.

Callers 1

mainFunction · 0.92

Calls 4

RunFunction · 0.92
RunFunction · 0.92
BuildConfigFromArgsFunction · 0.85
runControllerFunction · 0.85

Tested by

no test coverage detected