0

I am using dep to build dependencies.

In the below toml file , I hit issue in apimachinery

# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
required = ["k8s.io/apimachinery/pkg/api/resource", "k8s.io/apimachinery/pkg/apis/meta/v1", "k8s.io/apimachinery/pkg/apis/meta/v1"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
#   name = "github.com/user/project"
#   version = "1.0.0"
#
# [[constraint]]
#   name = "github.com/user/project2"
#   branch = "dev"
#   source = "github.com/myfork/project2"
#
# [[override]]
#  name = "github.com/x/y"
#  version = "2.4.0"


[[constraint]]
  name = "k8s.io/kubernetes"
  version = "v1.13.4"

[[override]]
  name = "k8s.io/kubernetes"
  version = "v1.13.4"

[[override]]
  version = "kubernetes-1.13.4"
  name = "k8s.io/api"

[[override]]
  name = "k8s.io/client-go"
  version = "v10.0.0"

#[[constraint]]
#  name = "k8s.io/client-go"
#  version = "v10.0.0"

[[constraint]]
  name = "k8s.io/apimachinery"
  version = "kubernetes-1.13.4"

#[[override]]
#  name = "k8s.io/apimachinery"
#  version = "kubernetes-1.13.4"

[[override]]
  source = "https://github.com/fsnotify/fsnotify/archive/v1.4.7.tar.gz"
  name = "gopkg.in/fsnotify.v1"

[prune]
  non-go = true
  go-tests = true
  unused-packages = true

ERROR

    kubernetes-1.13.4: Could not introduce k8s.io/apimachinery@kubernetes-1.13.4, as its subpackage k8s.io/apimachinery/pkg/api does not contain usable Go code (*build.NoGoError).. (Package is required by (root).)

WHAT I TRIED?

I added the required section to specify the exact packages being used but no luck.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
ambikanair
  • 4,004
  • 11
  • 43
  • 83
  • 1
    `dep` doesn't build anything, it just manages (tracks & downloads) dependencies. The error you're getting says there's no go files in that package; since the URL gives me a 404 I can't confirm but it's unlikely the error is wrong. You can't depend on an empty package. – Adrian May 23 '19 at 13:22
  • @Adrian Thanks. Will fix the import. Is there a way I can get toml file even if the `dep init` command fails for some package. https://github.com/golang/dep/issues/2171 – ambikanair May 23 '19 at 13:46
  • 1
    What do you mean "get toml file"? – Adrian May 23 '19 at 17:25
  • @ambikanair can you put the longer version of your error. (and in the meantime give a thought to using go modules :D) – diyoda_ Feb 24 '20 at 18:31

0 Answers0