[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Clientset for OpenShift resource clientset



Here is a test repo which works fine:

https://github.com/sttts/openshift-client-go-311-glide

Remember when calling glide to pass the `-v` option to drop nested vendor dirs.

Best regards,
   Stefan


On Thu, Feb 6, 2020 at 10:02 AM Lupin Deterd <lupindeterd gmail com> wrote:
Hi,

 I'm using glide as the dependency management as stated on the openshift/client-go INSTALL instruction and have the following defined in my glide.yaml

package: xxxx
import:
- package: github.com/openshift/client-o
  version: release-3.11

What else do I need to set explicitly?

Thank you for the assistance,
Lupin

On Thu, Feb 6, 2020 at 5:59 AM Stefan Schimanski <sttts redhat com> wrote:
Hello,

this is most probably a mismatch of the OpenShift client-go package and the Kubernetes client-go package (and all dependencies). Make sure that they match.

The OpenShift client-go on branch https://github.com/openshift/client-go/tree/release-3.11 is compatible with the 1.11 version of Kubernetes client-go which is called v8.0.0. Compare https://github.com/kubernetes/client-go#compatibility-matrix.

Best regards,
   Stefan


On Wed, Feb 5, 2020 at 5:32 PM Lupin Deterd <lupindeterd gmail com> wrote:
Hi,

I encounter this error whenever I include/import an openshift/client-go package, in this case the clientset for network policy extension(egressnetworkpolicy). I'm on using Openshift release-3.11.

Thanks,
Lupin


### error ###

github.com/user/podwatcher/vendor/github.com/openshift/client- go/network/clientset/versioned/typed/network/v1 vendor/github.com/openshift/client-go/network/clientset/versioned/typed/network/v1/clusternetwork.go:54:5: not enough arguments in call to c.client.Get().Resource("clusternetworks").Name(name).VersionedParams(&options, scheme.ParameterCodec).Do have () want (context.Context)
.....


### code snip ###

package main import ( "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/clientcmd" egressnetv1 "github.com/openshift/client-go/network/informers/externalversions/network/v1" egressnetclient "github.com/openshift/client-go/network/clientset/versioned/typed/network/v1" ) var logger *zap.Logger func main() { logger, _ = zap.NewProduction() defer logger.Sync() logger.Info("The pod watcher/logger started") kubeconfig := os.Getenv("KUBECONFIG") config, err := clientcmd.BuildConfigFromFlags("", kubeconfig) if err != nil { logger.Panic(err.Error()) os.Exit(1) } // clientset for NetworkPolicy clientset, err := kubernetes.NewForConfig(config) // clientset for EgressNetworkPolicy egressclientset, err := egressnetclient.NewForConfig(config) if err != nil { panic(err) . }


_______________________________________________
dev mailing list
dev lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/dev

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]