You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/02/07 02:37:00 UTC

[GitHub] [skywalking-infra-e2e] fgksgf commented on a change in pull request #7: Implement the verification of the actual data file

fgksgf commented on a change in pull request #7:
URL: https://github.com/apache/skywalking-infra-e2e/pull/7#discussion_r571519505



##########
File path: commands/setup/setup.go
##########
@@ -21,19 +21,30 @@ package setup
 import (
 	"fmt"
 
+	"github.com/apache/skywalking-infra-e2e/internal/components/setup"
 	"github.com/apache/skywalking-infra-e2e/internal/config"
-
 	"github.com/apache/skywalking-infra-e2e/internal/constant"
+	"github.com/apache/skywalking-infra-e2e/internal/logger"
+	"github.com/apache/skywalking-infra-e2e/internal/util"
 
 	"github.com/spf13/cobra"
-
-	"github.com/apache/skywalking-infra-e2e/internal/components/setup"
-	"github.com/apache/skywalking-infra-e2e/internal/logger"
 )
 
 var Setup = &cobra.Command{
 	Use:   "setup",
 	Short: "",
+	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
+		err := util.CheckDockerDaemon()
+		if err != nil {
+			return err
+		}
+
+		err = config.ReadGlobalConfigFile(constant.E2EDefaultFile)

Review comment:
       If we put `config.ReadGlobalConfigFile(constant.E2EDefaultFile)` in root command, we will not be able to verify with flags when there is no config file. 
   
   Maybe we should define an error type, like `CfgFileNotExistError`? If the returned error is that, then just log the information.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org