mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-12 21:01:36 +00:00
Revert "✨ Add community
, edition
and upgrade
commands"
This reverts commit 4b2c678fa3
.
This commit is contained in:
@@ -48,9 +48,7 @@ func InitConfig(cmd *cobra.Command) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
if cmd.Use != "edition" {
|
||||
go version.CheckNewerVersion()
|
||||
}
|
||||
go version.CheckNewerVersion()
|
||||
|
||||
Config = CreateDefaultConfig()
|
||||
cmdName = cmd.Name()
|
||||
@@ -61,7 +59,7 @@ func InitConfig(cmd *cobra.Command) error {
|
||||
|
||||
configFilePathFlag := cmd.Flags().Lookup(ConfigFilePathCommandName)
|
||||
configFilePath := configFilePathFlag.Value.String()
|
||||
if err := loadConfigFile(configFilePath, &Config, cmd.Use != "edition"); err != nil {
|
||||
if err := loadConfigFile(configFilePath, &Config); err != nil {
|
||||
if configFilePathFlag.Changed || !os.IsNotExist(err) {
|
||||
return fmt.Errorf("invalid config, %w\n"+
|
||||
"you can regenerate the file by removing it (%v) and using `kubeshark config -r`", err, configFilePath)
|
||||
@@ -101,7 +99,7 @@ func WriteConfig(config *ConfigStruct) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func loadConfigFile(configFilePath string, config *ConfigStruct, logPath bool) error {
|
||||
func loadConfigFile(configFilePath string, config *ConfigStruct) error {
|
||||
reader, openErr := os.Open(configFilePath)
|
||||
if openErr != nil {
|
||||
return openErr
|
||||
@@ -116,9 +114,7 @@ func loadConfigFile(configFilePath string, config *ConfigStruct, logPath bool) e
|
||||
return err
|
||||
}
|
||||
|
||||
if logPath {
|
||||
log.Info().Str("path", configFilePath).Msg("Found config file!")
|
||||
}
|
||||
log.Info().Str("path", configFilePath).Msg("Found config file!")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user