You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "ethan256 (via GitHub)" <gi...@apache.org> on 2023/02/16 09:20:41 UTC

[GitHub] [skywalking-infra-e2e] ethan256 commented on a diff in pull request #101: support pull images in kind mod (#10397)

ethan256 commented on code in PR #101:
URL: https://github.com/apache/skywalking-infra-e2e/pull/101#discussion_r1108210514


##########
internal/components/setup/kind.go:
##########
@@ -73,8 +76,29 @@ type kindPort struct {
 	waitExpose string // Need to use when expose
 }
 
-//nolint:gocyclo // skip the cyclomatic complexity check here
+// pullImages pull docker image from a private repository
+func pullImages(images []string) error {
+	cli, err := docker.NewClientWithOpts(docker.FromEnv)
+	if err != nil {
+		return err
+	}
+	defer cli.Close()
+
+	var out io.ReadCloser
+	for _, image := range images {
+		out, err = cli.ImagePull(context.Background(), image, types.ImagePullOptions{})
+		if err != nil {
+			logger.Log.Warn("pull image [%s] error", image)
+			return err
+		}
+		out.Close()
+	}
+	return nil

Review Comment:
   👌



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

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