Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Sara Wei committed Jan 3, 2024
2 parents 9cb6b38 + 2c93ca6 commit eba0ad9
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 2 deletions.
67 changes: 67 additions & 0 deletions cmd/kperf/commands/virtualcluster/nodepool.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package virtualcluster

import (
"fmt"

"github.com/urfave/cli"
)

var nodepoolCommand = cli.Command{
Name: "nodepool",
Usage: "Manage virtual node pools",
Flags: []cli.Flag{
cli.StringFlag{
Name: "kubeconfig",
Usage: "Path to the kubeconfig file",
},
},
Subcommands: []cli.Command{
nodepoolAddCommand,
nodepoolDelCommand,
nodepoolListCommand,
},
}

var nodepoolAddCommand = cli.Command{
Name: "add",
Usage: "Add a virtual node pool",
ArgsUsage: "NAME",
Flags: []cli.Flag{
cli.IntFlag{
Name: "nodes",
Usage: "The number of virtual nodes",
Value: 10,
},
cli.IntFlag{
Name: "cpu",
Usage: "The allocatable CPU resource per node",
Value: 8,
},
cli.IntFlag{
Name: "memory",
Usage: "The allocatable Memory resource per node (GiB)",
Value: 16,
},
},
Action: func(cliCtx *cli.Context) error {
return fmt.Errorf("nodepool add - not implemented")
},
}

var nodepoolDelCommand = cli.Command{
Name: "delete",
ShortName: "del",
ArgsUsage: "NAME",
Usage: "Delete a virtual node pool",
Action: func(cliCtx *cli.Context) error {
return fmt.Errorf("nodepool delete - not implemented")
},
}

var nodepoolListCommand = cli.Command{
Name: "list",
Usage: "List virtual node pools",
Action: func(cliCtx *cli.Context) error {
return fmt.Errorf("nodepool list - not implemented")
},
}
15 changes: 15 additions & 0 deletions cmd/kperf/commands/virtualcluster/vc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package virtualcluster

import "github.com/urfave/cli"

// const namespace = "kperf-virtualcluster"

// Command represents virtualcluster subcommand.
var Command = cli.Command{
Name: "virtualcluster",
ShortName: "vc",
Usage: "Setup virtual cluster and run workload on that",
Subcommands: []cli.Command{
nodepoolCommand,
},
}
2 changes: 0 additions & 2 deletions request/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ func NewClients(kubeCfgPath string, ConnsNum int, userAgent string, qps int, con
if qps == 0 {
qps = math.MaxInt32
}

restCfg.QPS = float32(qps)
restCfg.NegotiatedSerializer = scheme.Codecs.WithoutConversion()

restCfg.UserAgent = userAgent

if restCfg.UserAgent == "" {
restCfg.UserAgent = rest.DefaultKubernetesUserAgent()
}
Expand Down

0 comments on commit eba0ad9

Please sign in to comment.