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 2023/01/12 13:59:30 UTC

[GitHub] [skywalking-infra-e2e] dashanji opened a new pull request, #99: Export the kubeconfig path during executing the following steps.

dashanji opened a new pull request, #99:
URL: https://github.com/apache/skywalking-infra-e2e/pull/99

   As titled. 


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


[GitHub] [skywalking-infra-e2e] kezhenxu94 commented on a diff in pull request #99: Export the kubeconfig path during executing the following steps.

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on code in PR #99:
URL: https://github.com/apache/skywalking-infra-e2e/pull/99#discussion_r1068215338


##########
internal/components/setup/kind.go:
##########
@@ -106,6 +106,13 @@ func KindSetup(e2eConfig *config.E2EConfig) error {
 		if err := createKindCluster(kindConfigPath, e2eConfig); err != nil {
 			return err
 		}
+	} else {
+		// export the kubeconfig path for command line
+		err := os.Setenv("KUBECONFIG", kubeConfigPath)
+		if err != nil {
+			return fmt.Errorf("could not export kubeconfig file path, %v", err)
+		}
+		logger.Log.Infof("export KUBECONFIG=%s", kubeConfigPath)

Review Comment:
   > After the test, shall we unset the env var?
   
   This is to make it convenient running other commands in terminal after e2e command right? If so we might want to unset the env var in `cleanup` command, if possible, we might even want to revert `KUBECONFIG` to the original value before we change it. 



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


[GitHub] [skywalking-infra-e2e] wu-sheng merged pull request #99: Export the kubeconfig path during executing the following steps.

Posted by GitBox <gi...@apache.org>.
wu-sheng merged PR #99:
URL: https://github.com/apache/skywalking-infra-e2e/pull/99


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


[GitHub] [skywalking-infra-e2e] dashanji commented on a diff in pull request #99: Export the kubeconfig path during executing the following steps.

Posted by GitBox <gi...@apache.org>.
dashanji commented on code in PR #99:
URL: https://github.com/apache/skywalking-infra-e2e/pull/99#discussion_r1068242443


##########
internal/components/setup/kind.go:
##########
@@ -106,6 +106,13 @@ func KindSetup(e2eConfig *config.E2EConfig) error {
 		if err := createKindCluster(kindConfigPath, e2eConfig); err != nil {
 			return err
 		}
+	} else {
+		// export the kubeconfig path for command line
+		err := os.Setenv("KUBECONFIG", kubeConfigPath)
+		if err != nil {
+			return fmt.Errorf("could not export kubeconfig file path, %v", err)
+		}
+		logger.Log.Infof("export KUBECONFIG=%s", kubeConfigPath)

Review Comment:
   Yes, I think the `Setenv` is only valid in the process of the e2e test, and will not affect the original environment variables, so there is no need for additional `cleanup`. @fgksgf @kezhenxu94 please feel free to correct me if there is something I missed.



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


[GitHub] [skywalking-infra-e2e] fgksgf commented on a diff in pull request #99: Export the kubeconfig path during executing the following steps.

Posted by GitBox <gi...@apache.org>.
fgksgf commented on code in PR #99:
URL: https://github.com/apache/skywalking-infra-e2e/pull/99#discussion_r1068167892


##########
internal/components/setup/kind.go:
##########
@@ -106,6 +106,13 @@ func KindSetup(e2eConfig *config.E2EConfig) error {
 		if err := createKindCluster(kindConfigPath, e2eConfig); err != nil {
 			return err
 		}
+	} else {
+		// export the kubeconfig path for command line
+		err := os.Setenv("KUBECONFIG", kubeConfigPath)
+		if err != nil {
+			return fmt.Errorf("could not export kubeconfig file path, %v", err)
+		}
+		logger.Log.Infof("export KUBECONFIG=%s", kubeConfigPath)

Review Comment:
   What do you think? @kezhenxu94 



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


[GitHub] [skywalking-infra-e2e] fgksgf commented on a diff in pull request #99: Export the kubeconfig path during executing the following steps.

Posted by GitBox <gi...@apache.org>.
fgksgf commented on code in PR #99:
URL: https://github.com/apache/skywalking-infra-e2e/pull/99#discussion_r1068163985


##########
internal/components/setup/kind.go:
##########
@@ -106,6 +106,13 @@ func KindSetup(e2eConfig *config.E2EConfig) error {
 		if err := createKindCluster(kindConfigPath, e2eConfig); err != nil {
 			return err
 		}
+	} else {
+		// export the kubeconfig path for command line
+		err := os.Setenv("KUBECONFIG", kubeConfigPath)
+		if err != nil {
+			return fmt.Errorf("could not export kubeconfig file path, %v", err)
+		}
+		logger.Log.Infof("export KUBECONFIG=%s", kubeConfigPath)

Review Comment:
   After the test, shall we unset the env var?



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


[GitHub] [skywalking-infra-e2e] kezhenxu94 commented on a diff in pull request #99: Export the kubeconfig path during executing the following steps.

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on code in PR #99:
URL: https://github.com/apache/skywalking-infra-e2e/pull/99#discussion_r1068369358


##########
internal/components/setup/kind.go:
##########
@@ -106,6 +106,13 @@ func KindSetup(e2eConfig *config.E2EConfig) error {
 		if err := createKindCluster(kindConfigPath, e2eConfig); err != nil {
 			return err
 		}
+	} else {
+		// export the kubeconfig path for command line
+		err := os.Setenv("KUBECONFIG", kubeConfigPath)
+		if err != nil {
+			return fmt.Errorf("could not export kubeconfig file path, %v", err)
+		}
+		logger.Log.Infof("export KUBECONFIG=%s", kubeConfigPath)

Review Comment:
   OK. I thought you want to persist the env var after the e2e exits. LGTM



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