kezhenxu94 commented on a change in pull request #2:
URL: https://github.com/apache/skywalking-infra-e2e/pull/2#discussion_r551092200



##########
File path: go.mod
##########
@@ -5,4 +5,5 @@ go 1.13
 require (
        github.com/sirupsen/logrus v1.7.0
        github.com/spf13/cobra v1.1.1
+       sigs.k8s.io/kind v0.9.0

Review comment:
       Please also update the LICENSE and `dist/` license materials

##########
File path: internal/components/setup/kind.go
##########
@@ -0,0 +1,70 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package setup
+
+import (
+       "strings"
+
+       kind "sigs.k8s.io/kind/cmd/kind/app"
+       kindcmd "sigs.k8s.io/kind/pkg/cmd"
+
+       "github.com/apache/skywalking-infra-e2e/internal/flags"
+       "github.com/apache/skywalking-infra-e2e/internal/logger"
+)
+
+type ExecResult struct {
+       Command []string
+       Error   error
+       Stdout  string
+       StdErr  string
+}
+
+const (
+       Kind        = "kind"
+       KindCommand = "kind"
+)
+
+var (
+       // kind cluster create config
+       kindConfigFile string
+)
+
+// setup for kind, invoke from command line

Review comment:
       That's not the case now, we don't invoke from command line

##########
File path: internal/components/setup/kind.go
##########
@@ -0,0 +1,70 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package setup
+
+import (
+       "strings"
+
+       kind "sigs.k8s.io/kind/cmd/kind/app"
+       kindcmd "sigs.k8s.io/kind/pkg/cmd"
+
+       "github.com/apache/skywalking-infra-e2e/internal/flags"
+       "github.com/apache/skywalking-infra-e2e/internal/logger"
+)
+
+type ExecResult struct {
+       Command []string
+       Error   error
+       Stdout  string
+       StdErr  string
+}
+
+const (
+       Kind        = "kind"
+       KindCommand = "kind"
+)
+
+var (
+       // kind cluster create config
+       kindConfigFile string
+)
+
+// setup for kind, invoke from command line
+func KindSetupInCommand() error {
+       kindConfigFile = flags.File
+
+       if err := createKindCluster(); err != nil {
+               return err
+       }
+       return nil
+}
+
+func createKindCluster() error {
+       args := []string{"create", "cluster", "--config", kindConfigFile}
+       // quiet mode to suppress status output, so that the error is not 
logged repeatedly
+       args = append(args, "--quiet")

Review comment:
       This also depress the progress when installing normally.
   
   We better expose the progress and I think it's OK to log the errors 
repeatedly, which is rare case and do no harm actually.
   
   With progress we know what's going on, even if the machine is too slow to 
start up a cluster, we have expectations.




----------------------------------------------------------------
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:
[email protected]


Reply via email to