Code Monkey home page Code Monkey logo

Comments (9)

smecsia avatar smecsia commented on September 27, 2024 3

@fiunchinho the following helped me:

dep ensure -add k8s.io/apimachinery@1fd2e63a9a370677308a42f24fd40c86438afddf

from kubernetes-initializer-tutorial.

rajiteh avatar rajiteh commented on September 27, 2024 2

The following combination of constraints were required for me to successfully build the project.



[[constraint]]
  name = "github.com/ghodss/yaml"
  version = "1.0.0"
 
[[override]]
  name = "k8s.io/client-go"
  version = "5.0.0"
  
[[override]]
  revision = "019ae5ada31de202164b118aee88ee2d14075c31"
  name = "k8s.io/apimachinery"
  
[[override]]
  name = "github.com/ugorji/go"
  revision = "8c0409fcbb70099c748d71f714529204975f6c3f"

from kubernetes-initializer-tutorial.

Crazykev avatar Crazykev commented on September 27, 2024 1

I meet this just like @jorgesece , share my experience here in case anyone need.
I add override section in Gopkg.toml for apimachinery first, like:

[[override]]
  name = "k8s.io/apimachinery"
  revision = "1fd2e63a9a370677308a42f24fd40c86438afddf"

Then, run dep ensure and check if compile successfully, if not, continue to add override for other dependency that will satisfy. At last, remove all these override and run dep ensure again.

This is just a workaround, but do resolve my problem. Hope to be helpful.

from kubernetes-initializer-tutorial.

fiunchinho avatar fiunchinho commented on September 27, 2024

Just for reference, this is the generated Gopkg.toml

# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# 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 = "github.com/ghodss/yaml"
  version = "1.0.0"

[[constraint]]
  branch = "master"
  name = "k8s.io/api"

[[constraint]]
  branch = "master"
  name = "k8s.io/apimachinery"

[[constraint]]
  name = "k8s.io/client-go"
  version = "4.0.0"

Maybe I'm getting the wrong client-go version?

from kubernetes-initializer-tutorial.

kelseyhightower avatar kelseyhightower commented on September 27, 2024

Yeah. Getting all the deps right for the Kubernetes Go client can be challenging. I'll try to short things and out push them up so you don't have to.

from kubernetes-initializer-tutorial.

fiunchinho avatar fiunchinho commented on September 27, 2024

Thanks

from kubernetes-initializer-tutorial.

sebglon avatar sebglon commented on September 27, 2024

I have the same error and @smecsia cmd solve this.

from kubernetes-initializer-tutorial.

jorgesece avatar jorgesece commented on September 27, 2024

Hi there,
I think I having the same problem by using kubernetes v1.7.5.

# project/vendor/k8s.io/client-go/tools/clientcmd/api
src/project/vendor/k8s.io/client-go/tools/clientcmd/api/register.go:35:11: cannot use Config literal (type *Config) as type runtime.Object in argument to scheme.AddKnownTypes:
	*Config does not implement runtime.Object (missing DeepCopyObject method)
# project/vendor/k8s.io/client-go/pkg/api
src/project/vendor/k8s.io/client-go/pkg/api/register.go:76:8: cannot use Pod literal (type *Pod) as type runtime.Object in argument to scheme.AddKnownTypes:
	*Pod does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/client-go/pkg/api/register.go:77:12: cannot use PodList literal (type *PodList) as type runtime.Object in argument to scheme.AddKnownTypes:
	*PodList does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/client-go/pkg/api/register.go:78:20: cannot use PodStatusResult literal (type *PodStatusResult) as type runtime.Object in argument to scheme.AddKnownTypes:
	*PodStatusResult does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/client-go/pkg/api/register.go:79:16: cannot use PodTemplate literal (type *PodTemplate) as type runtime.Object in argument to scheme.AddKnownTypes:
	*PodTemplate does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/client-go/pkg/api/register.go:80:20: cannot use PodTemplateList literal (type *PodTemplateList) as type runtime.Object in argument to scheme.AddKnownTypes:
	*PodTemplateList does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/client-go/pkg/api/register.go:81:30: cannot use ReplicationControllerList literal (type *ReplicationControllerList) as type runtime.Object in argument to scheme.AddKnownTypes:
	*ReplicationControllerList does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/client-go/pkg/api/register.go:82:26: cannot use ReplicationController literal (type *ReplicationController) as type runtime.Object in argument to scheme.AddKnownTypes:
	*ReplicationController does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/client-go/pkg/api/register.go:83:16: cannot use ServiceList literal (type *ServiceList) as type runtime.Object in argument to scheme.AddKnownTypes:
	*ServiceList does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/client-go/pkg/api/register.go:84:12: cannot use Service literal (type *Service) as type runtime.Object in argument to scheme.AddKnownTypes:
	*Service does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/client-go/pkg/api/register.go:85:24: cannot use ServiceProxyOptions literal (type *ServiceProxyOptions) as type runtime.Object in argument to scheme.AddKnownTypes:
	*ServiceProxyOptions does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/client-go/pkg/api/register.go:85:24: too many errors
# project/vendor/k8s.io/kubernetes/pkg/api
src/project/vendor/k8s.io/kubernetes/pkg/api/register.go:76:8: cannot use Pod literal (type *Pod) as type runtime.Object in argument to scheme.AddKnownTypes:
	*Pod does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/kubernetes/pkg/api/register.go:77:12: cannot use PodList literal (type *PodList) as type runtime.Object in argument to scheme.AddKnownTypes:
	*PodList does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/kubernetes/pkg/api/register.go:78:20: cannot use PodStatusResult literal (type *PodStatusResult) as type runtime.Object in argument to scheme.AddKnownTypes:
	*PodStatusResult does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/kubernetes/pkg/api/register.go:79:16: cannot use PodTemplate literal (type *PodTemplate) as type runtime.Object in argument to scheme.AddKnownTypes:
	*PodTemplate does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/kubernetes/pkg/api/register.go:80:20: cannot use PodTemplateList literal (type *PodTemplateList) as type runtime.Object in argument to scheme.AddKnownTypes:
	*PodTemplateList does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/kubernetes/pkg/api/register.go:81:30: cannot use ReplicationControllerList literal (type *ReplicationControllerList) as type runtime.Object in argument to scheme.AddKnownTypes:
	*ReplicationControllerList does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/kubernetes/pkg/api/register.go:82:26: cannot use ReplicationController literal (type *ReplicationController) as type runtime.Object in argument to scheme.AddKnownTypes:
	*ReplicationController does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/kubernetes/pkg/api/register.go:83:16: cannot use ServiceList literal (type *ServiceList) as type runtime.Object in argument to scheme.AddKnownTypes:
	*ServiceList does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/kubernetes/pkg/api/register.go:84:12: cannot use Service literal (type *Service) as type runtime.Object in argument to scheme.AddKnownTypes:
	*Service does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/kubernetes/pkg/api/register.go:85:24: cannot use ServiceProxyOptions literal (type *ServiceProxyOptions) as type runtime.Object in argument to scheme.AddKnownTypes:
	*ServiceProxyOptions does not implement runtime.Object (missing DeepCopyObject method)
src/project/vendor/k8s.io/kubernetes/pkg/api/register.go:85:24: too many errors

When I try to set dep ensure -add k8s.io/apimachinery@1fd2e63a9a370677308a42f24fd40c86438afddf
I get an error:

ensure Solve(): No versions of k8s.io/apimachinery met constraints:	1fd2e63a9a370677308a42f24fd40c86438afddf: Could not introduce k8s.io/apimachinery@1fd2e63a9a370677308a42f24fd40c86438afddf, as its subpackage k8s.io/apimachinery does not contain usable Go code (*build.NoGoError).. (Package is required by (root).)

Does anyone help me?
Many Thanks

from kubernetes-initializer-tutorial.

paralin avatar paralin commented on September 27, 2024

I have the same thing, among other errors. And it's driving me INSANE.

ensure Solve(): No versions of k8s.io/apimachinery met constraints:
        1fd2e63a9a370677308a42f24fd40c86438afddf: unable to update checked out ve
rsion: : command failed: [git checkout 1fd2e63a9a370677308a42f24fd40c86438afddf]:
 exit status 128                                                                

WHAT? I can check it out just fine.

from kubernetes-initializer-tutorial.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.