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

Clientset for OpenShift resource clientset



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) . }



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