Skip to content

Commit

Permalink
Do not attempt to build HostNet assets (#16)
Browse files Browse the repository at this point in the history
Skip buildig the HostNetwork assets unless the user passes the `-all`
arg. HostNetwork will require some additional permissions.

Signed-off-by: Joe Talerico (rook) <[email protected]>

Signed-off-by: Joe Talerico (rook) <[email protected]>
  • Loading branch information
jtaleric authored Oct 17, 2022
1 parent 6329210 commit b4f56c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
7 changes: 4 additions & 3 deletions netperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ func main() {
os.Exit(1)
}
s := netperf.PerfScenarios{
NodeLocal: *nl,
RestConfig: *rconfig,
Configs: cfg,
HostNetwork: *full,
NodeLocal: *nl,
RestConfig: *rconfig,
Configs: cfg,
}
// Get node count
nodes, err := client.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{LabelSelector: "node-role.kubernetes.io/worker="})
Expand Down
12 changes: 8 additions & 4 deletions netperf/netperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ func BuildSUT(client *kubernetes.Clientset, s *PerfScenarios) error {
}

if ncount > 1 {
s.ClientHost, err = deployDeployment(client, cdpHostAcross)
if s.HostNetwork {
s.ClientHost, err = deployDeployment(client, cdpHostAcross)
}
if err != nil {
return err
}
Expand Down Expand Up @@ -253,9 +255,11 @@ func BuildSUT(client *kubernetes.Clientset, s *PerfScenarios) error {
}
sdpHost.PodAntiAffinity = antiAffinity
}
s.ServerHost, err = deployDeployment(client, sdpHost)
if err != nil {
return err
if s.HostNetwork {
s.ServerHost, err = deployDeployment(client, sdpHost)
if err != nil {
return err
}
}
s.Server, err = deployDeployment(client, sdp)
if err != nil {
Expand Down

0 comments on commit b4f56c2

Please sign in to comment.