aboutsummaryrefslogtreecommitdiff
path: root/sysutils/eksctl
diff options
context:
space:
mode:
authorDanilo Egea Gondolfo <danilo@FreeBSD.org>2018-08-17 21:43:38 +0000
committerDanilo Egea Gondolfo <danilo@FreeBSD.org>2018-08-17 21:43:38 +0000
commit03ac5dc93afe00a05032dabe6dbecd060a26d3dc (patch)
tree679bc461b7e06299758eb1a711405449b6422a28 /sysutils/eksctl
parent071682e2de9db76bd1c86798f8cbafd976a8ce4c (diff)
downloadports-03ac5dc93afe00a05032dabe6dbecd060a26d3dc.tar.gz
ports-03ac5dc93afe00a05032dabe6dbecd060a26d3dc.zip
Notes
Diffstat (limited to 'sysutils/eksctl')
-rw-r--r--sysutils/eksctl/Makefile39
-rw-r--r--sysutils/eksctl/distinfo3
-rw-r--r--sysutils/eksctl/files/patch-pkg_eks_auth.go11
-rw-r--r--sysutils/eksctl/files/patch-pkg_utils_kubectl.go45
-rw-r--r--sysutils/eksctl/pkg-descr5
5 files changed, 103 insertions, 0 deletions
diff --git a/sysutils/eksctl/Makefile b/sysutils/eksctl/Makefile
new file mode 100644
index 000000000000..71840b19c1ab
--- /dev/null
+++ b/sysutils/eksctl/Makefile
@@ -0,0 +1,39 @@
+# Created by: Danilo Egea Gondolfo <danilo@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= eksctl
+PORTVERSION= 0.1.0
+CATEGORIES= sysutils
+
+MAINTAINER= danilo@FreeBSD.org
+COMMENT= CLI for Amazon EKS
+
+LICENSE= APACHE20
+
+RUN_DEPENDS= kubectl:sysutils/kubectl \
+ aws-iam-authenticator:security/aws-iam-authenticator
+
+USES= go
+
+USE_GITHUB= yes
+GH_ACCOUNT= weaveworks
+
+PLIST_FILES= bin/${PORTNAME}
+
+post-patch:
+ ${LN} -s ${WRKSRC}/vendor ${WRKSRC}/src
+ ${MKDIR} ${WRKSRC}/src/github.com/weaveworks/eksctl
+ ${LN} -s ${WRKSRC}/pkg ${WRKSRC}/src/github.com/weaveworks/eksctl/pkg
+
+do-build:
+ cd ${WRKSRC}/cmd/${PORTNAME} && \
+ GOPATH=${WRKSRC} go build \
+ -ldflags="-X main.gitCommit=${PORTVERSION} \
+ -X main.builtAt=$$(date +'%s')"
+
+do-install:
+ ${INSTALL_PROGRAM} \
+ ${WRKSRC}/cmd/${PORTNAME}/${PORTNAME} \
+ ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+
+.include <bsd.port.mk>
diff --git a/sysutils/eksctl/distinfo b/sysutils/eksctl/distinfo
new file mode 100644
index 000000000000..5f83098242d2
--- /dev/null
+++ b/sysutils/eksctl/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1534530868
+SHA256 (weaveworks-eksctl-0.1.0_GH0.tar.gz) = 81ed110dcb67df9105034243453debba42aaf013d4dfe72ce292a52076bad023
+SIZE (weaveworks-eksctl-0.1.0_GH0.tar.gz) = 15217839
diff --git a/sysutils/eksctl/files/patch-pkg_eks_auth.go b/sysutils/eksctl/files/patch-pkg_eks_auth.go
new file mode 100644
index 000000000000..01c1d9372fbc
--- /dev/null
+++ b/sysutils/eksctl/files/patch-pkg_eks_auth.go
@@ -0,0 +1,11 @@
+--- pkg/eks/auth.go.orig 2018-08-17 20:19:48 UTC
++++ pkg/eks/auth.go
+@@ -192,7 +192,7 @@ func (c *ClientConfig) WithExecHeptioAuthenticator() *
+ x := clientConfigCopy.Client.AuthInfos[c.ContextName]
+ x.Exec = &clientcmdapi.ExecConfig{
+ APIVersion: "client.authentication.k8s.io/v1alpha1",
+- Command: "heptio-authenticator-aws",
++ Command: "aws-iam-authenticator",
+ Args: []string{"token", "-i", c.Cluster.ClusterName},
+ /*
+ Args: []string{"token", "-i", c.Cluster.ClusterName, "-r", c.roleARN},
diff --git a/sysutils/eksctl/files/patch-pkg_utils_kubectl.go b/sysutils/eksctl/files/patch-pkg_utils_kubectl.go
new file mode 100644
index 000000000000..19d244463143
--- /dev/null
+++ b/sysutils/eksctl/files/patch-pkg_utils_kubectl.go
@@ -0,0 +1,45 @@
+--- pkg/utils/kubectl.go.orig 2018-08-17 19:52:51 UTC
++++ pkg/utils/kubectl.go
+@@ -46,22 +46,12 @@ func CheckKubectlVersion(env []string) error {
+ return nil
+ }
+
+-func CheckHeptioAuthenticatorAWS() error {
+- path, err := exec.LookPath("heptio-authenticator-aws")
+- if err == nil {
+- logger.Debug("heptio-authenticator-aws: %q", path)
+- } else {
+- return fmt.Errorf("heptio-authenticator-aws not installed")
+- }
+- return nil
+-}
+-
+ func CheckAllCommands(kubeconfigPath string, isContextSet bool, contextName string, env []string) error {
+ if err := CheckKubectlVersion(env); err != nil {
+ return err
+ }
+
+- if err := CheckHeptioAuthenticatorAWS(); err != nil {
++ if err := checkAuthenticator(); err != nil {
+ return err
+ }
+
+@@ -97,4 +87,18 @@ func CheckAllCommands(kubeconfigPath string, isContext
+ }
+
+ return nil
++}
++
++// checkAuthenticator checks for the authenticator binary existence.
++func checkAuthenticator() error {
++ binaries := []string{"heptio-authenticator-aws", "aws-iam-authenticator"}
++ for _, bin := range binaries {
++ path, err := exec.LookPath(bin)
++ if err == nil {
++ // binary was found
++ logger.Debug("%s: %q", bin, path)
++ return nil
++ }
++ }
++ return fmt.Errorf("neither aws-iam-authenticator nor heptio-authenticator-aws are installed")
+ }
diff --git a/sysutils/eksctl/pkg-descr b/sysutils/eksctl/pkg-descr
new file mode 100644
index 000000000000..e224715a68e2
--- /dev/null
+++ b/sysutils/eksctl/pkg-descr
@@ -0,0 +1,5 @@
+eksctl is a simple CLI tool for creating clusters on EKS - Amazon's
+new managed Kubernetes service for EC2. It is written in Go,
+and based on Amazon's official CloudFormation templates.
+
+WWW: https://eksctl.io/