-
Notifications
You must be signed in to change notification settings - Fork 787
/
cli.go
40 lines (35 loc) · 1.53 KB
/
cli.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package amazon
import (
"github.com/jenkins-x/jx/v2/pkg/packages"
)
// InstallAwsIamAuthenticatorWithVersion install a specific version of iam authenticator for AWS
func InstallAwsIamAuthenticatorWithVersion(version string, skipPathScan bool) error {
return packages.InstallOrUpdateBinary(packages.InstallOrUpdateBinaryOptions{
Binary: "aws-iam-authenticator",
GitHubOrganization: "",
DownloadUrlTemplate: "https://amazon-eks.s3-us-west-2.amazonaws.com/{{.version}}/2019-03-27/bin/{{.os}}/{{.arch}}/aws-iam-authenticator",
Version: version,
SkipPathScan: skipPathScan,
VersionExtractor: nil,
})
}
// InstallAwsIamAuthenticator install iam authenticator for AWS
func InstallAwsIamAuthenticator(skipPathScan bool) error {
return InstallAwsIamAuthenticatorWithVersion(packages.IamAuthenticatorAwsVersion, skipPathScan)
}
// InstallEksCtlWithVersion install a specific version of eks cli
func InstallEksCtlWithVersion(version string, skipPathScan bool) error {
return packages.InstallOrUpdateBinary(packages.InstallOrUpdateBinaryOptions{
Binary: "eksctl",
GitHubOrganization: "weaveworks",
DownloadUrlTemplate: "https://github.com/weaveworks/eksctl/releases/download/{{.version}}/eksctl_{{.osTitle}}_{{.arch}}.{{.extension}}",
Version: version,
SkipPathScan: skipPathScan,
VersionExtractor: nil,
Archived: true,
})
}
// InstallEksCtl installs eks cli
func InstallEksCtl(skipPathScan bool) error {
return InstallEksCtlWithVersion("", skipPathScan)
}