mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 20:12:22 +08:00
K8s: Move standalone apiserver CLI to enterprise (#93799)
This commit is contained in:
@ -13,6 +13,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/infra/metrics"
|
||||
"github.com/grafana/grafana/pkg/server"
|
||||
"github.com/grafana/grafana/pkg/services/apiserver/standalone"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
@ -22,18 +23,17 @@ func TargetCommand(version, commit, buildBranch, buildstamp string) *cli.Command
|
||||
Usage: "target specific grafana dskit services",
|
||||
Flags: commonFlags,
|
||||
Action: func(context *cli.Context) error {
|
||||
return RunTargetServer(ServerOptions{
|
||||
return RunTargetServer(standalone.BuildInfo{
|
||||
Version: version,
|
||||
Commit: commit,
|
||||
BuildBranch: buildBranch,
|
||||
BuildStamp: buildstamp,
|
||||
Context: context,
|
||||
})
|
||||
}, context)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func RunTargetServer(opts ServerOptions) error {
|
||||
func RunTargetServer(opts standalone.BuildInfo, cli *cli.Context) error {
|
||||
if Version || VerboseVersion {
|
||||
fmt.Printf("Version %s (commit: %s, branch: %s)\n", opts.Version, opts.Commit, opts.BuildBranch)
|
||||
if VerboseVersion {
|
||||
@ -83,7 +83,7 @@ func RunTargetServer(opts ServerOptions) error {
|
||||
Config: ConfigFile,
|
||||
HomePath: HomePath,
|
||||
// tailing arguments have precedence over the options string
|
||||
Args: append(configOptions, opts.Context.Args().Slice()...),
|
||||
Args: append(configOptions, cli.Args().Slice()...),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user