Skip to content

Commit

Permalink
Merge pull request openshift-kni#848 from shajmakh/single-flag-v-ref
Browse files Browse the repository at this point in the history
flags: identify -v with single hyphen
  • Loading branch information
openshift-merge-bot[bot] authored Feb 19, 2024
2 parents 55d5173 + feb158e commit d939af7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ spec:
operator: Exists
containers:
- args:
- --v=4
- -v=4
- --leader-elect
- --enable-scheduler
command:
Expand Down
2 changes: 1 addition & 1 deletion config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
- "--logtostderr=true"
- "--v=10"
- "-v=10"
ports:
- containerPort: 8443
protocol: TCP
Expand Down
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
- command:
- /bin/numaresources-operator
args:
- --v=4
- -v=4
- --leader-elect
- --enable-scheduler
image: controller:latest
Expand Down
2 changes: 1 addition & 1 deletion pkg/loglevel/loglevel.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func UpdatePodSpec(podSpec *corev1.PodSpec, cntName string, level operatorv1.Log
if flags == nil {
return fmt.Errorf("cannot modify the arguments for container %s", cnt.Name)
}
flags.SetOption("--v", kLog.String())
flags.SetOption("-v", kLog.String())
klog.InfoS("container klog level", "container", cnt.Name, "-v", kLog.String())
cnt.Args = flags.Argv()
return nil
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/rte/rte_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ var _ = ginkgo.Describe("with a running cluster with all the components", func()

found, match := matchLogLevelToKlog(rteCnt, nropObj.Spec.LogLevel)
if !found {
klog.Warningf("--v flag doesn't exist in container %q args managed by DaemonSet: %q", rteCnt.Name, ds.Name)
klog.Warningf("-v flag doesn't exist in container %q args managed by DaemonSet: %q", rteCnt.Name, ds.Name)
return false
}
if !match {
klog.Warningf("LogLevel %s doesn't match the existing --v flag in container: %q under DaemonSet: %q", nropObj.Spec.LogLevel, rteCnt.Name, ds.Name)
klog.Warningf("LogLevel %s doesn't match the existing -v flag in container: %q under DaemonSet: %q", nropObj.Spec.LogLevel, rteCnt.Name, ds.Name)
return false
}
}
Expand Down Expand Up @@ -121,12 +121,12 @@ var _ = ginkgo.Describe("with a running cluster with all the components", func()

found, match := matchLogLevelToKlog(rteCnt, nropObj.Spec.LogLevel)
if !found {
klog.Warningf("--v flag doesn't exist in container %q args under DaemonSet: %q", rteCnt.Name, ds.Name)
klog.Warningf("-v flag doesn't exist in container %q args under DaemonSet: %q", rteCnt.Name, ds.Name)
return false
}

if !match {
klog.Warningf("LogLevel %s doesn't match the existing --v flag in container: %q managed by DaemonSet: %q", nropObj.Spec.LogLevel, rteCnt.Name, ds.Name)
klog.Warningf("LogLevel %s doesn't match the existing -v flag in container: %q managed by DaemonSet: %q", nropObj.Spec.LogLevel, rteCnt.Name, ds.Name)
return false
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/serial/tests/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,12 @@ var _ = Describe("[serial][disruptive][slow] numaresources configuration managem
cnt := &ds.Spec.Template.Spec.Containers[0]
found, match := matchLogLevelToKlog(cnt, nroOperObj.Spec.LogLevel)
if !found {
klog.Warningf("--v flag doesn't exist in container %q args under DaemonSet: %q", cnt.Name, ds.Name)
klog.Warningf("-v flag doesn't exist in container %q args under DaemonSet: %q", cnt.Name, ds.Name)
return false, nil
}

if !match {
klog.Warningf("LogLevel %s doesn't match the existing --v flag in container: %q managed by DaemonSet: %q", nroOperObj.Spec.LogLevel, cnt.Name, ds.Name)
klog.Warningf("LogLevel %s doesn't match the existing -v flag in container: %q managed by DaemonSet: %q", nroOperObj.Spec.LogLevel, cnt.Name, ds.Name)
return false, nil
}
}
Expand Down

0 comments on commit d939af7

Please sign in to comment.