1

I'm trying to connect to AWS EKS cluster using lambda written with Go.

My import looks like that:

  import (
        "encoding/base64"
        "fmt"
    
        "github.com/aws/aws-sdk-go/aws"
        "github.com/aws/aws-sdk-go/aws/awserr"
        "github.com/aws/aws-sdk-go/aws/session"
        "github.com/aws/aws-sdk-go/service/eks"
        "github.com/kubernetes-sigs/aws-iam-authenticator/pkg/token"
    )

My actual code which requires import of github.com/kubernetes-sigs/aws-iam-authenticator/pkg/token package is the following:

gen, err := token.NewGenerator(false)
    if err != nil {
        panic(err)
    }

However, when I'm using go get command, I'm getting this error.

go get github.com/kubernetes-sigs/aws-iam-authenticator/pkg/token
go: found github.com/kubernetes-sigs/aws-iam-authenticator/pkg/token in github.com/kubernetes-sigs/aws-iam-authenticator v0.5.1
go get: github.com/kubernetes-sigs/aws-iam-authenticator@v0.5.1: parsing go.mod:
        module declares its path as: sigs.k8s.io/aws-iam-authenticator
                but was required as: github.com/kubernetes-sigs/aws-iam-authenticator

and I'm not able to workaround it. Can you help?

danny.lesnik
  • 18,479
  • 29
  • 135
  • 200
  • As the error says, you are using the wrong import path for `aws-iam-authenticator`, try the suggested one. – Marc Sep 14 '20 at 14:10
  • 1
    If import is from the docs, worth posting as an issue to https://github.com/kubernetes-sigs/aws-iam-authenticator/issues – Max Lobur Sep 14 '20 at 14:26
  • @Marc, but I',m importing github.com/kubernetes-sigs/aws-iam-authenticator/pkg/token aws-iam-authenticator is obviously one of internal imports. – danny.lesnik Sep 14 '20 at 17:00
  • And the import path is wrong, it's "sigs.k8s.io/aws-iam-authenticator/pkg/token` as the error message clearly states. – Marc Sep 14 '20 at 17:01

0 Answers0