Skip to content

Commit

Permalink
*: update "KubectlCommand"
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <[email protected]>
  • Loading branch information
gyuho committed Nov 29, 2018
1 parent d382c3b commit 4349ca6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 21 deletions.
10 changes: 0 additions & 10 deletions eksconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -983,16 +983,6 @@ func (cfg *Config) UpdateFromEnvs() error {
return nil
}

// ArgsKubectlVersion returns the parameters to "kubectl" tests.
func (cfg *Config) ArgsKubectlVersion() []string {
return []string{
cfg.KubectlPath,
"--kubeconfig=" + cfg.KubeConfigPath,
"--match-server-version=false",
"version",
}
}

// supportedKubernetesVersions is a list of EKS supported Kubernets versions.
var supportedKubernetesVersions = map[string]struct{}{
"1.10": {},
Expand Down
6 changes: 1 addition & 5 deletions internal/eks/tester_embedded.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,7 @@ func newTesterEmbedded(cfg *eksconfig.Config) (ekstester.Tester, error) {

// KubectlCommand returns "kubectl" command object for API reachability tests.
func (md *embedded) KubectlCommand() (*osexec.Cmd, error) {
args := md.cfg.ArgsKubectlVersion()
if len(args) < 1 {
return nil, errors.New("empty kubectl arguments")
}
return osexec.Command(args[0], args[1:]...), nil
return osexec.Command(md.cfg.KubectlPath, "--kubeconfig="+md.cfg.KubeConfigPath), nil
}

// Up creates an EKS cluster for 'kubetest'.
Expand Down
7 changes: 1 addition & 6 deletions kubetest/eks/eks.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ limitations under the License.
package eks

import (
"errors"
"fmt"
"io"
"io/ioutil"
Expand Down Expand Up @@ -229,11 +228,7 @@ func (dp *deployer) KubectlCommand() (*osexec.Cmd, error) {
if _, err := dp.LoadConfig(); err != nil {
return nil, err
}
args := dp.cfg.ArgsKubectlVersion()
if len(args) < 1 {
return nil, errors.New("empty kubectl arguments")
}
return osexec.Command(args[0], args[1:]...), nil
return osexec.Command(dp.cfg.KubectlPath, "--kubeconfig="+dp.cfg.KubeConfigPath), nil
}

// Stop stops ongoing operations.
Expand Down

0 comments on commit 4349ca6

Please sign in to comment.