INNER CODE UNIT · Go
runApplication
deckhouse/deckhouse · dhctl/cmd/dhctl/main.go:334
func runApplication(ctx context.Context, kpApp *kingpin.Application, opts *options.Options) {
initer := newActionIniter(opts)
// inject context.Context to kingpin.ParseContext
//
// Actions run once the flags are parsed, so opts.Kube is populated here: stamp the context
// with the auth mode those flags produce. Every retry loop under this command reads it to
// tell an apiserver that cannot answer yet from credentials that will never be allowed.
kpApp.Action(func(c *kingpin.ParseContext) error {
return kpcontext.SetContextToAction(
providerinitializer.WithKubeAuthMode(ctx, &opts.Kube),
)(c)
})
kpApp.Action(func(c *kingpin.ParseContext) error {
return telemetry.Bootstrap(kpcontext.ExtractContext(c))
})