Skip to content

Commit

Permalink
Minor nits/updates
Browse files Browse the repository at this point in the history
Signed-off-by: Krishna Harsha Voora <[email protected]>
  • Loading branch information
krishvoor committed Nov 21, 2024
1 parent cf74566 commit 607b288
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cmd/config/udn-density-pods/udn-density-pods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ jobs:
pod-security.kubernetes.io/audit: privileged
pod-security.kubernetes.io/warn: privileged
objects:
{{ if eq .ENABLE_LAYER_2 "true"}}
- objectTemplate: udn_l2.yml
{{ if eq .ENABLE_LAYER_3 "true"}}
- objectTemplate: udn_l3.yml
replicas: 1
{{ else }}
- objectTemplate: udn_l3.yml
- objectTemplate: udn_l2.yml
replicas: 1
{{ end }}

Expand Down
11 changes: 5 additions & 6 deletions udn-density-pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ import (
// NewUDNDensityPods holds udn-density-pods workload
func NewUDNDensityPods(wh *workloads.WorkloadHelper) *cobra.Command {
var churnPercent, churnCycles, iterations int
var churn bool
var churn, l3 bool
var churnDelay, churnDuration, podReadyThreshold time.Duration
var churnDeletionStrategy string
var metricsProfiles []string
var mode string
var rc int
cmd := &cobra.Command{
Use: "udn-density-pods",
Expand All @@ -49,18 +48,18 @@ func NewUDNDensityPods(wh *workloads.WorkloadHelper) *cobra.Command {
Run: func(cmd *cobra.Command, args []string) {
setMetrics(cmd, metricsProfiles)
// Disable l3 when the user chooses l2
if mode == "layer3" {
os.Setenv("ENABLE_LAYER_2", "false")
if l3 {
os.Setenv("ENABLE_LAYER_3", "true")
} else {
os.Setenv("ENABLE_LAYER_2", "true")
os.Setenv("ENABLE_LAYER_3", "false")
}
rc = wh.Run("udn-density-pods")
},
PostRun: func(cmd *cobra.Command, args []string) {
os.Exit(rc)
},
}
cmd.Flags().StringVar(&mode, "mode", "layer3", "Layer3 UDN test")
cmd.Flags().BoolVar(&l3, "layer3", true, "Layer3 UDN test")
cmd.Flags().BoolVar(&churn, "churn", true, "Enable churning")
cmd.Flags().IntVar(&churnCycles, "churn-cycles", 0, "Churn cycles to execute")
cmd.Flags().DurationVar(&churnDuration, "churn-duration", 1*time.Hour, "Churn duration")
Expand Down

0 comments on commit 607b288

Please sign in to comment.