🐛 Fix selfnamespace issue by changing its location in the config and adding --selfnamespace flag to tap and clean commands

This commit is contained in:
M. Mert Yildiran
2023-03-26 23:26:35 +03:00
parent 261df8261f
commit 7f6f710b3f
13 changed files with 49 additions and 37 deletions

View File

@@ -3,7 +3,10 @@ package cmd
import (
"fmt"
"github.com/creasty/defaults"
"github.com/kubeshark/kubeshark/config/configStructs"
"github.com/kubeshark/kubeshark/misc"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
)
@@ -18,4 +21,11 @@ var cleanCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(cleanCmd)
defaultTapConfig := configStructs.TapConfig{}
if err := defaults.Set(&defaultTapConfig); err != nil {
log.Debug().Err(err).Send()
}
cleanCmd.Flags().StringP(configStructs.SelfNamespaceLabel, "s", defaultTapConfig.SelfNamespace, "Self-namespace of Kubeshark")
}