@@ -20,7 +20,6 @@ import (
20
20
"crypto"
21
21
"os"
22
22
"path"
23
- "runtime"
24
23
25
24
"github.com/golang/glog"
26
25
"github.com/jimmidyson/go-download"
@@ -40,7 +39,7 @@ func CacheBinariesForBootstrapper(version string, clusterBootstrapper string) er
40
39
for _ , bin := range binaries {
41
40
bin := bin
42
41
g .Go (func () error {
43
- if _ , err := CacheBinary (bin , version , "linux" , runtime . GOARCH ); err != nil {
42
+ if _ , err := CacheBinary (bin , version ); err != nil {
44
43
return errors .Wrapf (err , "caching image %s" , bin )
45
44
}
46
45
return nil
@@ -50,11 +49,11 @@ func CacheBinariesForBootstrapper(version string, clusterBootstrapper string) er
50
49
}
51
50
52
51
// 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 ) {
54
53
targetDir := constants .MakeMiniPath ("cache" , version )
55
54
targetFilepath := path .Join (targetDir , binary )
56
55
57
- url := constants .GetKubernetesReleaseURL (binary , version , osName , archName )
56
+ url := constants .GetKubernetesReleaseURL (binary , version )
58
57
59
58
_ , err := os .Stat (targetFilepath )
60
59
// If it exists, do no verification and continue
@@ -74,18 +73,13 @@ func CacheBinary(binary, version, osName, archName string) (string, error) {
74
73
Mkdirs : download .MkdirAll ,
75
74
}
76
75
77
- options .Checksum = constants .GetKubernetesReleaseURLSHA1 (binary , version , osName , archName )
76
+ options .Checksum = constants .GetKubernetesReleaseURLSHA1 (binary , version )
78
77
options .ChecksumHash = crypto .SHA1
79
78
80
79
console .OutStyle ("file-download" , "Downloading %s %s" , binary , version )
81
80
if err := download .ToFile (url , targetFilepath , options ); err != nil {
82
81
return "" , errors .Wrapf (err , "Error downloading %s %s" , binary , version )
83
82
}
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
- }
89
83
return targetFilepath , nil
90
84
}
91
85
0 commit comments