Skip to content

Commit c6c68ae

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 c6c68ae

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/agent/config.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,9 @@ func InitAgentCmdFlags(c *cobra.Command, cfg *AgentCmdFlags) {
334334
false,
335335
"Deprecated. No longer has an effect.",
336336
)
337-
_ = c.PersistentFlags().MarkDeprecated("disable-compression", "no longer has an effect")
337+
if err := c.PersistentFlags().MarkDeprecated("disable-compression", "no longer has an effect"); err != nil {
338+
panic(err)
339+
}
338340

339341
// This is a hidden feature flag we use to build the "Machine Hub" feature
340342
// gradually without impacting customers. Once the feature is GA, we will
@@ -345,7 +347,9 @@ func InitAgentCmdFlags(c *cobra.Command, cfg *AgentCmdFlags) {
345347
false,
346348
"Enables the MachineHub mode. The agent will push data to CyberArk MachineHub.",
347349
)
348-
_ = c.PersistentFlags().MarkHidden("machine-hub")
350+
if err := c.PersistentFlags().MarkHidden("machine-hub"); err != nil {
351+
panic(err)
352+
}
349353

350354
}
351355

0 commit comments

Comments
 (0)