Skip to content

Commit

Permalink
sysdump: derive operator namespace from agent namespace if specified
Browse files Browse the repository at this point in the history
Co-authored-by: Michi Mutsuzaki <[email protected]>
Signed-off-by: Marcel Zieba <[email protected]>
  • Loading branch information
marseel and michi-covalent committed Jun 27, 2024
1 parent 9f4af5c commit 92440dd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cli/sysdump.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ func newCmdSysdump(hooks sysdump.Hooks) *cobra.Command {
if sysdumpOptions.CiliumNamespace == "" && cmd.Flags().Changed("namespace") {
sysdumpOptions.CiliumNamespace = namespace
}
if sysdumpOptions.CiliumOperatorNamespace == "" && cmd.Flags().Changed("namespace") {
sysdumpOptions.CiliumOperatorNamespace = namespace
if sysdumpOptions.CiliumOperatorNamespace == "" {
if cmd.Flags().Changed("namespace") {
sysdumpOptions.CiliumOperatorNamespace = namespace
} else {
// Assume the same namespace for operator as for agent if not specified
sysdumpOptions.CiliumOperatorNamespace = sysdumpOptions.CiliumNamespace
}
}
// Honor --helm-release-name global flag in case it is set and --cilium-helm-release-name is not set
if sysdumpOptions.CiliumHelmReleaseName == "" && cmd.Flags().Changed("helm-release-name") {
Expand Down

0 comments on commit 92440dd

Please sign in to comment.