diff --git a/import-export-cli/cmd/delete.go b/import-export-cli/cmd/delete.go index 1c7144941..8f519d9a8 100644 --- a/import-export-cli/cmd/delete.go +++ b/import-export-cli/cmd/delete.go @@ -28,8 +28,8 @@ import ( // Delete command related usage Info const deleteCmdLiteral = "delete" const deleteCmdShortDesc = "Delete an API/Application in an environment" -const deleteCmdLongDesc = `Delete an API available in the environment specified by flag (--environment, -e) in default mode/ -Delete an Application of a specific user in the environment specified by flag (--environment, -e) in default mode/ +const deleteCmdLongDesc = `Delete an API available in the environment specified by flag (--environment, -e) in default mode +Delete an Application of a specific user in the environment specified by flag (--environment, -e) in default mode Delete resources by filenames, stdin, resources and names, or by resources and label selector in kubernetes mode` const deleteCmdExamples = utils.ProjectName + ` ` + deleteCmdLiteral + ` ` + deleteAPICmdLiteral + ` -n TwitterAPI -v 1.0.0 -r admin -e dev diff --git a/import-export-cli/cmd/deleteAPI.go b/import-export-cli/cmd/deleteAPI.go index 969411eb0..e837a7f79 100644 --- a/import-export-cli/cmd/deleteAPI.go +++ b/import-export-cli/cmd/deleteAPI.go @@ -175,8 +175,11 @@ func init() { "Provider of the API to be deleted") DeleteAPICmd.Flags().StringVarP(&deleteAPIEnvironment, "environment", "e", "", "Environment from which the API should be deleted") - configVars := utils.GetMainConfigFromFile(utils.MainConfigFilePath) - if !configVars.Config.KubernetesMode { + + // fetches the main-config.yaml file silently; i.e. if it's not created, ignore the error and assume that + // this is the default mode. + configVars := utils.GetMainConfigFromFileSilently(utils.MainConfigFilePath) + if configVars == nil || !configVars.Config.KubernetesMode { // Mark required flags _ = DeleteAPICmd.MarkFlagRequired("name") _ = DeleteAPICmd.MarkFlagRequired("version")