@@ -110,6 +110,7 @@ type CLI struct {
110110 addEnvVars map [string ]string
111111
112112 verbose bool
113+ showInfo bool // control framework.Logf output
113114 withoutNamespace bool
114115 withManagedNamespace bool
115116 kubeFramework * framework.Framework
@@ -134,6 +135,7 @@ func NewCLIWithFramework(kubeFramework *framework.Framework) *CLI {
134135 execPath : "oc" ,
135136 adminConfigPath : KubeConfigPath (),
136137 staticConfigManifestDir : StaticConfigManifestDir (),
138+ showInfo : true ,
137139 }
138140 // Called only once (assumed the objects will never get modified)
139141 // TODO: run in every BeforeEach
@@ -178,6 +180,7 @@ func NewCLIWithoutNamespace(project string) *CLI {
178180 execPath : "oc" ,
179181 adminConfigPath : KubeConfigPath (),
180182 staticConfigManifestDir : StaticConfigManifestDir (),
183+ showInfo : true ,
181184 withoutNamespace : true ,
182185 }
183186 g .BeforeEach (cli .kubeFramework .BeforeEach )
@@ -211,6 +214,7 @@ func NewCLIForMonitorTest(project string) *CLI {
211214 execPath : "oc" ,
212215 adminConfigPath : KubeConfigPath (),
213216 staticConfigManifestDir : StaticConfigManifestDir (),
217+ showInfo : true ,
214218 withoutNamespace : true ,
215219 }
216220
@@ -241,6 +245,7 @@ func NewHypershiftManagementCLI(project string) *CLI {
241245 username : "admin" ,
242246 execPath : "oc" ,
243247 adminConfigPath : kubeconfig ,
248+ showInfo : true ,
244249 withoutNamespace : true ,
245250 }
246251}
@@ -1020,7 +1025,10 @@ func (c *CLI) start(stdOutBuff, stdErrBuff *bytes.Buffer) (*exec.Cmd, error) {
10201025 cmd := exec .Command (c .execPath , c .finalArgs ... )
10211026 cmd .Stdin = c .stdin
10221027 // Redact any bearer token information from the log.
1023- framework .Logf ("Running '%s %s'" , c .execPath , RedactBearerToken (strings .Join (c .finalArgs , " " )))
1028+ // Only log if showInfo is enabled (controlled by util_otp)
1029+ if c .showInfo {
1030+ framework .Logf ("Running '%s %s'" , c .execPath , RedactBearerToken (strings .Join (c .finalArgs , " " )))
1031+ }
10241032
10251033 cmd .Env = c .env
10261034 if len (c .addEnvVars ) > 0 {
0 commit comments