Skip to content

Commit

Permalink
remove flag for debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
Sara Wei committed Mar 11, 2024
1 parent fc1a5d3 commit 7ec5f62
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/kperf/commands/runnergroup/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var runCommand = cli.Command{
// Right now, we need to set image manually.
Required: true,
},
<<<<<<< HEAD

Check failure on line 37 in cmd/kperf/commands/runnergroup/run.go

View workflow job for this annotation

GitHub Actions / linter

expected operand, found '<<' (typecheck)
cli.StringFlag{
Name: "runner-flowcontrol",
Usage: "Apply flowcontrol to runner group. (FORMAT: PriorityLevel:MatchingPrecedence)",
Expand All @@ -42,6 +43,11 @@ var runCommand = cli.Command{
cli.StringSliceFlag{
Name: "affinity",
Usage: "Deploy server to the node with a specific labels (FORMAT: KEY=VALUE[,VALUE])",
=======
cli.BoolFlag{
Name: "debug",
Usage: "Turn on debug logging",
>>>>>>> a1f6e97 (add flag for debug log)

Check failure on line 50 in cmd/kperf/commands/runnergroup/run.go

View workflow job for this annotation

GitHub Actions / linter

missing ',' in composite literal (typecheck)
},
},
Action: func(cliCtx *cli.Context) error {
Expand Down Expand Up @@ -69,12 +75,17 @@ var runCommand = cli.Command{
}

kubeCfgPath := cliCtx.GlobalString("kubeconfig")
debugFlag := cliCtx.Bool("debug")
return runner.CreateRunnerGroupServer(context.Background(),
kubeCfgPath,
imgRef,
specs[0],
<<<<<<< HEAD
runner.WithRunCmdServerNodeSelectorsOpt(affinityLabels),
runner.WithRunCmdRunnerGroupFlowControl(priorityLevel, matchingPrecedence),
=======
debugFlag,
>>>>>>> a1f6e97 (add flag for debug log)
)
},
}
Expand Down
1 change: 1 addition & 0 deletions cmd/kperf/commands/virtualcluster/nodepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ var nodepoolAddCommand = cli.Command{
return virtualcluster.CreateNodepool(context.Background(),
kubeCfgPath,
nodepoolName,
debugFlag,
virtualcluster.WithNodepoolCPUOpt(cliCtx.Int("cpu")),
virtualcluster.WithNodepoolMemoryOpt(cliCtx.Int("memory")),
virtualcluster.WithNodepoolCountOpt(cliCtx.Int("nodes")),
Expand Down
1 change: 1 addition & 0 deletions helmcli/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func NewReleaseCli(
name string,
ch *chart.Chart,
labels map[string]string,
debug bool,

Check warning on line 107 in helmcli/release.go

View workflow job for this annotation

GitHub Actions / linter

unused-parameter: parameter 'debug' seems to be unused, consider removing or renaming it as _ (revive)
valuesAppliers ...ValuesApplier,
) (*ReleaseCli, error) {
// build default values
Expand Down
17 changes: 17 additions & 0 deletions virtualcluster/nodes_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
// TODO:
// 1. create a new package to define ErrNotFound, ErrAlreadyExists, ... errors.
// 2. support configurable timeout.
<<<<<<< HEAD

Check failure on line 17 in virtualcluster/nodes_create.go

View workflow job for this annotation

GitHub Actions / test

syntax error: non-declaration statement outside function body

Check failure on line 17 in virtualcluster/nodes_create.go

View workflow job for this annotation

GitHub Actions / build

syntax error: non-declaration statement outside function body
//
// FIXME:
//
Expand All @@ -33,6 +34,9 @@ import (
// workaround. For example, if node.Spec.ProviderID contains `?ignore=virtual`,
// the cloud providers should ignore this kind of nodes.
func CreateNodepool(ctx context.Context, kubeCfgPath string, nodepoolName string, opts ...NodepoolOpt) (retErr error) {
=======

Check failure on line 37 in virtualcluster/nodes_create.go

View workflow job for this annotation

GitHub Actions / test

syntax error: unexpected ==, expected }

Check failure on line 37 in virtualcluster/nodes_create.go

View workflow job for this annotation

GitHub Actions / build

syntax error: unexpected ==, expected }
func CreateNodepool(ctx context.Context, kubeconfigPath string, nodepoolName string, debugFlag bool, opts ...NodepoolOpt) error {
>>>>>>> a1f6e97 (add flag for debug log)

Check failure on line 39 in virtualcluster/nodes_create.go

View workflow job for this annotation

GitHub Actions / test

syntax error: unexpected >>, expected }

Check failure on line 39 in virtualcluster/nodes_create.go

View workflow job for this annotation

GitHub Actions / build

syntax error: unexpected >>, expected }
cfg := defaultNodepoolCfg
for _, opt := range opts {
opt(&cfg)
Expand Down Expand Up @@ -70,13 +74,26 @@ func CreateNodepool(ctx context.Context, kubeCfgPath string, nodepoolName string
return fmt.Errorf("failed to load virtual node chart: %w", err)
}

<<<<<<< HEAD
=======
cfgValues, err := cfg.toHelmValuesAppliers(nodepoolName)
if err != nil {
return fmt.Errorf("failed to convert to helm values: %w", err)
}

>>>>>>> a1f6e97 (add flag for debug log)
releaseCli, err := helmcli.NewReleaseCli(
kubeCfgPath,
virtualnodeReleaseNamespace,
cfg.nodeHelmReleaseName(),
ch,
virtualnodeReleaseLabels,
<<<<<<< HEAD
cfg.toNodeHelmValuesAppliers()...,
=======
debugFlag,
cfgValues...,
>>>>>>> a1f6e97 (add flag for debug log)
)
if err != nil {
return fmt.Errorf("failed to create helm release client: %w", err)
Expand Down

0 comments on commit 7ec5f62

Please sign in to comment.