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 2eaa2e1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/kperf/commands/runnergroup/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ var Command = cli.Command{
statusCommand,
},
}

// debuLog function to log messages using klog.
func debugLog(level klog.Level, format string, args ...interface{}) {

Check failure on line 31 in cmd/kperf/commands/runnergroup/root.go

View workflow job for this annotation

GitHub Actions / test

undefined: klog

Check failure on line 31 in cmd/kperf/commands/runnergroup/root.go

View workflow job for this annotation

GitHub Actions / build

undefined: klog

Check failure on line 31 in cmd/kperf/commands/runnergroup/root.go

View workflow job for this annotation

GitHub Actions / linter

undefined: klog
klog.V(level).Infof(format, args...)

Check failure on line 32 in cmd/kperf/commands/runnergroup/root.go

View workflow job for this annotation

GitHub Actions / test

undefined: klog

Check failure on line 32 in cmd/kperf/commands/runnergroup/root.go

View workflow job for this annotation

GitHub Actions / build

undefined: klog

Check failure on line 32 in cmd/kperf/commands/runnergroup/root.go

View workflow job for this annotation

GitHub Actions / linter

undefined: klog (typecheck)
}
1 change: 1 addition & 0 deletions cmd/kperf/commands/runnergroup/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ var runCommand = cli.Command{
}

kubeCfgPath := cliCtx.GlobalString("kubeconfig")

return runner.CreateRunnerGroupServer(context.Background(),
kubeCfgPath,
imgRef,
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

Check failure on line 17 in virtualcluster/nodes_create.go

View workflow job for this annotation

GitHub Actions / linter

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 }

Check failure on line 37 in virtualcluster/nodes_create.go

View workflow job for this annotation

GitHub Actions / linter

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 }

Check failure on line 39 in virtualcluster/nodes_create.go

View workflow job for this annotation

GitHub Actions / linter

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 2eaa2e1

Please sign in to comment.