Skip to content

Commit baa0bd0

Browse files
Merge pull request #4192 from kubernetes/revert-3646-kubectl
Revert "Initial implementation of kubectl command"
2 parents ec6fc41 + 63bfd32 commit baa0bd0

File tree

4 files changed

+10
-104
lines changed

4 files changed

+10
-104
lines changed

cmd/minikube/cmd/kubectl.go

-88
This file was deleted.

pkg/minikube/bootstrapper/kubeadm/kubeadm.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"fmt"
2323
"net"
2424
"net/http"
25-
"runtime"
2625
"strings"
2726
"time"
2827

@@ -573,7 +572,7 @@ func downloadBinaries(cfg config.KubernetesConfig, c bootstrapper.CommandRunner)
573572
for _, bin := range constants.GetKubeadmCachedBinaries() {
574573
bin := bin
575574
g.Go(func() error {
576-
path, err := machine.CacheBinary(bin, cfg.KubernetesVersion, "linux", runtime.GOARCH)
575+
path, err := machine.CacheBinary(bin, cfg.KubernetesVersion)
577576
if err != nil {
578577
return errors.Wrapf(err, "downloading %s", bin)
579578
}

pkg/minikube/constants/constants.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"fmt"
2121
"os"
2222
"path/filepath"
23+
"runtime"
2324
"strings"
2425
"time"
2526

@@ -220,13 +221,13 @@ const (
220221
)
221222

222223
// GetKubernetesReleaseURL gets the location of a kubernetes client
223-
func GetKubernetesReleaseURL(binaryName, version, osName, archName string) string {
224-
return fmt.Sprintf("https://storage.googleapis.com/kubernetes-release/release/%s/bin/%s/%s/%s", version, osName, archName, binaryName)
224+
func GetKubernetesReleaseURL(binaryName, version string) string {
225+
return fmt.Sprintf("https://storage.googleapis.com/kubernetes-release/release/%s/bin/linux/%s/%s", version, runtime.GOARCH, binaryName)
225226
}
226227

227228
// GetKubernetesReleaseURLSHA1 gets the location of a kubernetes client checksum
228-
func GetKubernetesReleaseURLSHA1(binaryName, version, osName, archName string) string {
229-
return fmt.Sprintf("%s.sha1", GetKubernetesReleaseURL(binaryName, version, osName, archName))
229+
func GetKubernetesReleaseURLSHA1(binaryName, version string) string {
230+
return fmt.Sprintf("%s.sha1", GetKubernetesReleaseURL(binaryName, version))
230231
}
231232

232233
// IsMinikubeChildProcess is the name of "is minikube child process" variable

pkg/minikube/machine/cache_binaries.go

+4-10
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"crypto"
2121
"os"
2222
"path"
23-
"runtime"
2423

2524
"github.com/golang/glog"
2625
"github.com/jimmidyson/go-download"
@@ -40,7 +39,7 @@ func CacheBinariesForBootstrapper(version string, clusterBootstrapper string) er
4039
for _, bin := range binaries {
4140
bin := bin
4241
g.Go(func() error {
43-
if _, err := CacheBinary(bin, version, "linux", runtime.GOARCH); err != nil {
42+
if _, err := CacheBinary(bin, version); err != nil {
4443
return errors.Wrapf(err, "caching image %s", bin)
4544
}
4645
return nil
@@ -50,11 +49,11 @@ func CacheBinariesForBootstrapper(version string, clusterBootstrapper string) er
5049
}
5150

5251
// CacheBinary will cache a binary on the host
53-
func CacheBinary(binary, version, osName, archName string) (string, error) {
52+
func CacheBinary(binary, version string) (string, error) {
5453
targetDir := constants.MakeMiniPath("cache", version)
5554
targetFilepath := path.Join(targetDir, binary)
5655

57-
url := constants.GetKubernetesReleaseURL(binary, version, osName, archName)
56+
url := constants.GetKubernetesReleaseURL(binary, version)
5857

5958
_, err := os.Stat(targetFilepath)
6059
// If it exists, do no verification and continue
@@ -74,18 +73,13 @@ func CacheBinary(binary, version, osName, archName string) (string, error) {
7473
Mkdirs: download.MkdirAll,
7574
}
7675

77-
options.Checksum = constants.GetKubernetesReleaseURLSHA1(binary, version, osName, archName)
76+
options.Checksum = constants.GetKubernetesReleaseURLSHA1(binary, version)
7877
options.ChecksumHash = crypto.SHA1
7978

8079
console.OutStyle("file-download", "Downloading %s %s", binary, version)
8180
if err := download.ToFile(url, targetFilepath, options); err != nil {
8281
return "", errors.Wrapf(err, "Error downloading %s %s", binary, version)
8382
}
84-
if osName == runtime.GOOS && archName == runtime.GOARCH {
85-
if err = os.Chmod(targetFilepath, 0755); err != nil {
86-
return "", errors.Wrapf(err, "chmod +x %s", targetFilepath)
87-
}
88-
}
8983
return targetFilepath, nil
9084
}
9185

0 commit comments

Comments
 (0)