Parcourir la source

minor changes

Mohammed Nafees il y a 4 ans
Parent
commit
6e513513cf
3 fichiers modifiés avec 7 ajouts et 7 suppressions
  1. 5 5
      api/client/k8s.go
  2. 1 1
      cli/cmd/portforward.go
  3. 1 1
      cli/cmd/run.go

+ 5 - 5
api/client/k8s.go

@@ -59,15 +59,15 @@ func (c *Client) GetKubeconfig(
 	ctx context.Context,
 	projectID uint,
 	clusterID uint,
-	localKubeconfig string,
+	localKubeconfigPath string,
 ) (*types.GetTemporaryKubeconfigResponse, error) {
 	resp := &types.GetTemporaryKubeconfigResponse{}
 
-	if localKubeconfig != "" {
-		color.New(color.FgBlue).Printf("using local kubeconfig: %s\n", localKubeconfig)
+	if localKubeconfigPath != "" {
+		color.New(color.FgBlue).Printf("using local kubeconfig: %s\n", localKubeconfigPath)
 
-		if _, err := os.Stat(localKubeconfig); !os.IsNotExist(err) {
-			file, err := os.Open(localKubeconfig)
+		if _, err := os.Stat(localKubeconfigPath); !os.IsNotExist(err) {
+			file, err := os.Open(localKubeconfigPath)
 
 			if err != nil {
 				return nil, err

+ 1 - 1
cli/cmd/portforward.go

@@ -145,7 +145,7 @@ func portForward(user *types.GetAuthenticatedUserResponse, client *api.Client, a
 		pod = pods[0]
 	}
 
-	kubeResp, err := client.GetKubeconfig(context.TODO(), cliConf.Project, cliConf.Cluster, cliConf.Kubeconfig)
+	kubeResp, err := client.GetKubeconfig(context.Background(), cliConf.Project, cliConf.Cluster, cliConf.Kubeconfig)
 
 	if err != nil {
 		return err

+ 1 - 1
cli/cmd/run.go

@@ -264,7 +264,7 @@ func (p *PorterRunSharedConfig) setSharedConfig() error {
 	pID := cliConf.Project
 	cID := cliConf.Cluster
 
-	kubeResp, err := p.Client.GetKubeconfig(context.TODO(), pID, cID, cliConf.Kubeconfig)
+	kubeResp, err := p.Client.GetKubeconfig(context.Background(), pID, cID, cliConf.Kubeconfig)
 
 	if err != nil {
 		return err