Skip to content

Commit 6d2a1d4

Browse files
committed
panic instead of ignoring error to prevent operations to get out of sync
Signed-off-by: Tim Ramlot <[email protected]>
1 parent c952b26 commit 6d2a1d4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

pkg/agent/config.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ func InitAgentCmdFlags(c *cobra.Command, cfg *AgentCmdFlags) {
232232
false,
233233
fmt.Sprintf("Turns on the %s mode. The flag --credentials-file must also be passed.", JetstackSecureOAuth),
234234
)
235-
_ = c.PersistentFlags().MarkHidden("venafi-cloud")
235+
if err := c.PersistentFlags().MarkHidden("venafi-cloud"); err != nil {
236+
panic(err)
237+
}
236238
c.PersistentFlags().StringVarP(
237239
&cfg.ClientID,
238240
"client-id",
@@ -334,7 +336,9 @@ func InitAgentCmdFlags(c *cobra.Command, cfg *AgentCmdFlags) {
334336
false,
335337
"Deprecated. No longer has an effect.",
336338
)
337-
_ = c.PersistentFlags().MarkDeprecated("disable-compression", "no longer has an effect")
339+
if err := c.PersistentFlags().MarkDeprecated("disable-compression", "no longer has an effect"); err != nil {
340+
panic(err)
341+
}
338342

339343
// This is a hidden feature flag we use to build the "Machine Hub" feature
340344
// gradually without impacting customers. Once the feature is GA, we will
@@ -345,7 +349,9 @@ func InitAgentCmdFlags(c *cobra.Command, cfg *AgentCmdFlags) {
345349
false,
346350
"Enables the MachineHub mode. The agent will push data to CyberArk MachineHub.",
347351
)
348-
_ = c.PersistentFlags().MarkHidden("machine-hub")
352+
if err := c.PersistentFlags().MarkHidden("machine-hub"); err != nil {
353+
panic(err)
354+
}
349355

350356
}
351357

0 commit comments

Comments
 (0)