From 1b7c6001ec1142ab1d01ef77da4ee723cc648b8c Mon Sep 17 00:00:00 2001 From: Scott Weiss Date: Mon, 30 Apr 2018 15:36:12 -0400 Subject: [PATCH 1/3] code generation for crd clients Signed-off-by: Scott Weiss --- Makefile | 4 + pkg/storage/crd/crd_storage_client.go | 1 + .../crd/solo.io/client_template.go.tmpl | 171 ++++++++++++++++++ pkg/storage/crd/solo.io/generate_clients.go | 69 +++++++ pkg/storage/crd/upstreams.go | 32 ++-- pkg/storage/crd/virtual_services.go | 81 ++++----- 6 files changed, 301 insertions(+), 57 deletions(-) create mode 100644 pkg/storage/crd/solo.io/client_template.go.tmpl create mode 100644 pkg/storage/crd/solo.io/generate_clients.go diff --git a/Makefile b/Makefile index b5ffdd59a97..58b401f222e 100644 --- a/Makefile +++ b/Makefile @@ -52,6 +52,10 @@ clientset: $(GENERATED_PROTO_FILES) $(SOURCES) $(PACKAGE_PATH)/pkg/storage/crd \ "solo.io:v1" +.PHONY: generated-code +generated-code: + go generate ./... + $(OUTPUT): mkdir -p $(OUTPUT) diff --git a/pkg/storage/crd/crd_storage_client.go b/pkg/storage/crd/crd_storage_client.go index fe210e270e4..f9fd5cc582d 100644 --- a/pkg/storage/crd/crd_storage_client.go +++ b/pkg/storage/crd/crd_storage_client.go @@ -18,6 +18,7 @@ import ( crdv1 "github.com/solo-io/gloo/pkg/storage/crd/solo.io/v1" ) +//go:generate go run ${GOPATH}/src/github.com/solo-io/gloo/pkg/storage/crd/solo.io/generate_clients.go type Client struct { v1 *v1client } diff --git a/pkg/storage/crd/solo.io/client_template.go.tmpl b/pkg/storage/crd/solo.io/client_template.go.tmpl new file mode 100644 index 00000000000..19f9f764ed6 --- /dev/null +++ b/pkg/storage/crd/solo.io/client_template.go.tmpl @@ -0,0 +1,171 @@ +package crd + +import ( + "time" + + "github.com/pkg/errors" + "github.com/solo-io/gloo/pkg/api/types/v1" + "github.com/solo-io/gloo/pkg/storage" + crdclientset "github.com/solo-io/gloo/pkg/storage/crd/client/clientset/versioned" + crdv1 "github.com/solo-io/gloo/pkg/storage/crd/solo.io/v1" + apiexts "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" + + "github.com/solo-io/gloo/pkg/storage/crud" + kuberrs "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/client-go/tools/cache" +) + +type {{ .LowercasePluralName }}Client struct { + crds crdclientset.Interface + apiexts apiexts.Interface + // write and read objects to this namespace if not specified on the GlooObjects + namespace string + syncFrequency time.Duration +} + +func (c *{{ .LowercasePluralName }}Client) Create(item *v1.{{ .UppercaseName }}) (*v1.{{ .UppercaseName }}, error) { + return c.createOrUpdate{{ .UppercaseName }}Crd(item, crud.OperationCreate) +} + +func (c *{{ .LowercasePluralName }}Client) Update(item *v1.{{ .UppercaseName }}) (*v1.{{ .UppercaseName }}, error) { + return c.createOrUpdate{{ .UppercaseName }}Crd(item, crud.OperationUpdate) +} + +func (c *{{ .LowercasePluralName }}Client) Delete(name string) error { + return c.crds.GlooV1().{{ .UppercasePluralName }}(c.namespace).Delete(name, nil) +} + +func (c *{{ .LowercasePluralName }}Client) Get(name string) (*v1.{{ .UppercaseName }}, error) { + crd{{ .UppercaseName }}, err := c.crds.GlooV1().{{ .UppercasePluralName }}(c.namespace).Get(name, metav1.GetOptions{}) + if err != nil { + return nil, errors.Wrap(err, "failed performing get api request") + } + returned{{ .UppercaseName }}, err := {{ .UppercaseName }}FromCrd(crd{{ .UppercaseName }}) + if err != nil { + return nil, errors.Wrap(err, "converting returned crd to {{ .LowercaseName }}") + } + return returned{{ .UppercaseName }}, nil +} + +func (c *{{ .LowercasePluralName }}Client) List() ([]*v1.{{ .UppercaseName }}, error) { + crdList, err := c.crds.GlooV1().{{ .UppercasePluralName }}(c.namespace).List(metav1.ListOptions{}) + if err != nil { + return nil, errors.Wrap(err, "failed performing list api request") + } + var returned{{ .UppercasePluralName }} []*v1.{{ .UppercaseName }} + for _, crd{{ .UppercaseName }} := range crdList.Items { + {{ .LowercaseName }}, err := {{ .UppercaseName }}FromCrd(&crd{{ .UppercaseName }}) + if err != nil { + return nil, errors.Wrap(err, "converting returned crd to {{ .LowercaseName }}") + } + returned{{ .UppercasePluralName }} = append(returned{{ .UppercasePluralName }}, {{ .LowercaseName }}) + } + return returned{{ .UppercasePluralName }}, nil +} + +func (u *{{ .LowercasePluralName }}Client) Watch(handlers ...storage.{{ .UppercaseName }}EventHandler) (*storage.Watcher, error) { + lw := cache.NewListWatchFromClient(u.crds.GlooV1().RESTClient(), crdv1.{{ .UppercaseName }}CRD.Plural, u.namespace, fields.Everything()) + sw := cache.NewSharedInformer(lw, new(crdv1.{{ .UppercaseName }}), u.syncFrequency) + for _, h := range handlers { + sw.AddEventHandler(&{{ .LowercaseName }}EventHandler{handler: h, store: sw.GetStore()}) + } + return storage.NewWatcher(func(stop <-chan struct{}, _ chan error) { + sw.Run(stop) + }), nil +} + +func (c *{{ .LowercasePluralName }}Client) createOrUpdate{{ .UppercaseName }}Crd({{ .LowercaseName }} *v1.{{ .UppercaseName }}, op crud.Operation) (*v1.{{ .UppercaseName }}, error) { + {{ .LowercaseName }}Crd, err := {{ .UppercaseName }}ToCrd(c.namespace, {{ .LowercaseName }}) + if err != nil { + return nil, errors.Wrap(err, "converting gloo object to crd") + } + {{ .LowercasePluralName }} := c.crds.GlooV1().{{ .UppercasePluralName }}({{ .LowercaseName }}Crd.Namespace) + var returnedCrd *crdv1.{{ .UppercaseName }} + switch op { + case crud.OperationCreate: + returnedCrd, err = {{ .LowercasePluralName }}.Create({{ .LowercaseName }}Crd) + if err != nil { + if kuberrs.IsAlreadyExists(err) { + return nil, storage.NewAlreadyExistsErr(err) + } + return nil, errors.Wrap(err, "kubernetes create api request") + } + case crud.OperationUpdate: + // need to make sure we preserve labels + currentCrd, err := {{ .LowercasePluralName }}.Get({{ .LowercaseName }}Crd.Name, metav1.GetOptions{ResourceVersion: {{ .LowercaseName }}Crd.ResourceVersion}) + if err != nil { + return nil, errors.Wrap(err, "kubernetes get api request") + } + // copy labels + {{ .LowercaseName }}Crd.Labels = currentCrd.Labels + returnedCrd, err = {{ .LowercasePluralName }}.Update({{ .LowercaseName }}Crd) + if err != nil { + return nil, errors.Wrap(err, "kubernetes update api request") + } + } + returned{{ .UppercaseName }}, err := {{ .UppercaseName }}FromCrd(returnedCrd) + if err != nil { + return nil, errors.Wrap(err, "converting returned crd to {{ .LowercaseName }}") + } + return returned{{ .UppercaseName }}, nil +} + +// implements the kubernetes ResourceEventHandler interface +type {{ .LowercaseName }}EventHandler struct { + handler storage.{{ .UppercaseName }}EventHandler + store cache.Store +} + +func (eh *{{ .LowercaseName }}EventHandler) getUpdatedList() []*v1.{{ .UppercaseName }} { + updatedList := eh.store.List() + var updated{{ .UppercaseName }}List []*v1.{{ .UppercaseName }} + for _, updated := range updatedList { + {{ .LowercaseName }}Crd, ok := updated.(*crdv1.{{ .UppercaseName }}) + if !ok { + continue + } + updated{{ .UppercaseName }}, err := {{ .UppercaseName }}FromCrd({{ .LowercaseName }}Crd) + if err != nil { + continue + } + updated{{ .UppercaseName }}List = append(updated{{ .UppercaseName }}List, updated{{ .UppercaseName }}) + } + return updated{{ .UppercaseName }}List +} + +func convert{{ .UppercaseName }}(obj interface{}) (*v1.{{ .UppercaseName }}, bool) { + {{ .LowercaseName }}Crd, ok := obj.(*crdv1.{{ .UppercaseName }}) + if !ok { + return nil, ok + } + {{ .LowercaseName }}, err := {{ .UppercaseName }}FromCrd({{ .LowercaseName }}Crd) + if err != nil { + return nil, false + } + return {{ .LowercaseName }}, ok +} + +func (eh *{{ .LowercaseName }}EventHandler) OnAdd(obj interface{}) { + {{ .LowercaseName }}, ok := convert{{ .UppercaseName }}(obj) + if !ok { + return + } + eh.handler.OnAdd(eh.getUpdatedList(), {{ .LowercaseName }}) +} +func (eh *{{ .LowercaseName }}EventHandler) OnUpdate(_, newObj interface{}) { + new{{ .UppercaseName }}, ok := convert{{ .UppercaseName }}(newObj) + if !ok { + return + } + eh.handler.OnUpdate(eh.getUpdatedList(), new{{ .UppercaseName }}) +} + +func (eh *{{ .LowercaseName }}EventHandler) OnDelete(obj interface{}) { + {{ .LowercaseName }}, ok := convert{{ .UppercaseName }}(obj) + if !ok { + return + } + eh.handler.OnDelete(eh.getUpdatedList(), {{ .LowercaseName }}) +} diff --git a/pkg/storage/crd/solo.io/generate_clients.go b/pkg/storage/crd/solo.io/generate_clients.go new file mode 100644 index 00000000000..255cc998bef --- /dev/null +++ b/pkg/storage/crd/solo.io/generate_clients.go @@ -0,0 +1,69 @@ +package main + +import ( + "flag" + "github.com/solo-io/gloo/test/helpers" + "path/filepath" + "github.com/solo-io/gloo/pkg/log" + "github.com/pkg/errors" + "bytes" + "io/ioutil" + "text/template" +) + +type clientType struct { + FilenamePrefix string + LowercaseName string + LowercasePluralName string + UppercaseName string + UppercasePluralName string +} + +var clients = []clientType{ + { + FilenamePrefix: "upstreams", + LowercaseName: "upstream", + LowercasePluralName: "upstreams", + UppercaseName: "Upstream", + UppercasePluralName: "Upstreams", + }, + { + FilenamePrefix: "virtual_services", + LowercaseName: "virtualService", + LowercasePluralName: "virtualServices", + UppercaseName: "VirtualService", + UppercasePluralName: "VirtualServices", + }, +} + +func main() { + baseDir := filepath.Join(helpers.GlooSoloDirectory(), "pkg", "storage", "crd") + inputFile := flag.String("f", filepath.Join(baseDir, "solo.io", "client_template.go.tmpl"), "input client template") + outputDirectory := flag.String("o", baseDir, "output directory for client files") + flag.Parse() + if err := writeClientTemplates(*inputFile, *outputDirectory); err != nil { + log.Fatalf("failed generating client templates: %s", err.Error()) + } + log.Printf("success") +} + +func writeClientTemplates(inputFile, outputDir string) error { + fileName := filepath.Base(inputFile) + for _, client := range clients { + tmpl, err := template.New("Test_Resources").ParseFiles(inputFile) + if err != nil { + return errors.Wrap(err, "parsing template from "+inputFile) + } + + buf := &bytes.Buffer{} + if err := tmpl.ExecuteTemplate(buf, fileName, client); err != nil { + return errors.Wrap(err, "executing template") + } + + err = ioutil.WriteFile(filepath.Join(outputDir, client.FilenamePrefix+".go"), buf.Bytes(), 0644) + if err != nil { + return errors.Wrap(err, "writing generated client bytes") + } + } + return nil +} diff --git a/pkg/storage/crd/upstreams.go b/pkg/storage/crd/upstreams.go index 6f754f350ce..16afc4e7d64 100644 --- a/pkg/storage/crd/upstreams.go +++ b/pkg/storage/crd/upstreams.go @@ -38,11 +38,11 @@ func (c *upstreamsClient) Delete(name string) error { } func (c *upstreamsClient) Get(name string) (*v1.Upstream, error) { - crdUs, err := c.crds.GlooV1().Upstreams(c.namespace).Get(name, metav1.GetOptions{}) + crdUpstream, err := c.crds.GlooV1().Upstreams(c.namespace).Get(name, metav1.GetOptions{}) if err != nil { return nil, errors.Wrap(err, "failed performing get api request") } - returnedUpstream, err := UpstreamFromCrd(crdUs) + returnedUpstream, err := UpstreamFromCrd(crdUpstream) if err != nil { return nil, errors.Wrap(err, "converting returned crd to upstream") } @@ -55,8 +55,8 @@ func (c *upstreamsClient) List() ([]*v1.Upstream, error) { return nil, errors.Wrap(err, "failed performing list api request") } var returnedUpstreams []*v1.Upstream - for _, crdUs := range crdList.Items { - upstream, err := UpstreamFromCrd(&crdUs) + for _, crdUpstream := range crdList.Items { + upstream, err := UpstreamFromCrd(&crdUpstream) if err != nil { return nil, errors.Wrap(err, "converting returned crd to upstream") } @@ -122,11 +122,11 @@ func (eh *upstreamEventHandler) getUpdatedList() []*v1.Upstream { updatedList := eh.store.List() var updatedUpstreamList []*v1.Upstream for _, updated := range updatedList { - usCrd, ok := updated.(*crdv1.Upstream) + upstreamCrd, ok := updated.(*crdv1.Upstream) if !ok { continue } - updatedUpstream, err := UpstreamFromCrd(usCrd) + updatedUpstream, err := UpstreamFromCrd(upstreamCrd) if err != nil { continue } @@ -135,37 +135,37 @@ func (eh *upstreamEventHandler) getUpdatedList() []*v1.Upstream { return updatedUpstreamList } -func convertUs(obj interface{}) (*v1.Upstream, bool) { - usCrd, ok := obj.(*crdv1.Upstream) +func convertUpstream(obj interface{}) (*v1.Upstream, bool) { + upstreamCrd, ok := obj.(*crdv1.Upstream) if !ok { return nil, ok } - us, err := UpstreamFromCrd(usCrd) + upstream, err := UpstreamFromCrd(upstreamCrd) if err != nil { return nil, false } - return us, ok + return upstream, ok } func (eh *upstreamEventHandler) OnAdd(obj interface{}) { - us, ok := convertUs(obj) + upstream, ok := convertUpstream(obj) if !ok { return } - eh.handler.OnAdd(eh.getUpdatedList(), us) + eh.handler.OnAdd(eh.getUpdatedList(), upstream) } func (eh *upstreamEventHandler) OnUpdate(_, newObj interface{}) { - newUs, ok := convertUs(newObj) + newUpstream, ok := convertUpstream(newObj) if !ok { return } - eh.handler.OnUpdate(eh.getUpdatedList(), newUs) + eh.handler.OnUpdate(eh.getUpdatedList(), newUpstream) } func (eh *upstreamEventHandler) OnDelete(obj interface{}) { - us, ok := convertUs(obj) + upstream, ok := convertUpstream(obj) if !ok { return } - eh.handler.OnDelete(eh.getUpdatedList(), us) + eh.handler.OnDelete(eh.getUpdatedList(), upstream) } diff --git a/pkg/storage/crd/virtual_services.go b/pkg/storage/crd/virtual_services.go index 801aec317bd..74829318717 100644 --- a/pkg/storage/crd/virtual_services.go +++ b/pkg/storage/crd/virtual_services.go @@ -25,38 +25,38 @@ type virtualServicesClient struct { syncFrequency time.Duration } -func (v *virtualServicesClient) Create(item *v1.VirtualService) (*v1.VirtualService, error) { - return v.createOrUpdateVirtualServiceCrd(item, crud.OperationCreate) +func (c *virtualServicesClient) Create(item *v1.VirtualService) (*v1.VirtualService, error) { + return c.createOrUpdateVirtualServiceCrd(item, crud.OperationCreate) } -func (v *virtualServicesClient) Update(item *v1.VirtualService) (*v1.VirtualService, error) { - return v.createOrUpdateVirtualServiceCrd(item, crud.OperationUpdate) +func (c *virtualServicesClient) Update(item *v1.VirtualService) (*v1.VirtualService, error) { + return c.createOrUpdateVirtualServiceCrd(item, crud.OperationUpdate) } -func (v *virtualServicesClient) Delete(name string) error { - return v.crds.GlooV1().VirtualServices(v.namespace).Delete(name, nil) +func (c *virtualServicesClient) Delete(name string) error { + return c.crds.GlooV1().VirtualServices(c.namespace).Delete(name, nil) } -func (v *virtualServicesClient) Get(name string) (*v1.VirtualService, error) { - crdVh, err := v.crds.GlooV1().VirtualServices(v.namespace).Get(name, metav1.GetOptions{}) +func (c *virtualServicesClient) Get(name string) (*v1.VirtualService, error) { + crdVirtualService, err := c.crds.GlooV1().VirtualServices(c.namespace).Get(name, metav1.GetOptions{}) if err != nil { return nil, errors.Wrap(err, "failed performing get api request") } - returnedVirtualService, err := VirtualServiceFromCrd(crdVh) + returnedVirtualService, err := VirtualServiceFromCrd(crdVirtualService) if err != nil { return nil, errors.Wrap(err, "converting returned crd to virtualService") } return returnedVirtualService, nil } -func (v *virtualServicesClient) List() ([]*v1.VirtualService, error) { - crdList, err := v.crds.GlooV1().VirtualServices(v.namespace).List(metav1.ListOptions{}) +func (c *virtualServicesClient) List() ([]*v1.VirtualService, error) { + crdList, err := c.crds.GlooV1().VirtualServices(c.namespace).List(metav1.ListOptions{}) if err != nil { return nil, errors.Wrap(err, "failed performing list api request") } var returnedVirtualServices []*v1.VirtualService - for _, crdVh := range crdList.Items { - virtualService, err := VirtualServiceFromCrd(&crdVh) + for _, crdVirtualService := range crdList.Items { + virtualService, err := VirtualServiceFromCrd(&crdVirtualService) if err != nil { return nil, errors.Wrap(err, "converting returned crd to virtualService") } @@ -65,9 +65,9 @@ func (v *virtualServicesClient) List() ([]*v1.VirtualService, error) { return returnedVirtualServices, nil } -func (v *virtualServicesClient) Watch(handlers ...storage.VirtualServiceEventHandler) (*storage.Watcher, error) { - lw := cache.NewListWatchFromClient(v.crds.GlooV1().RESTClient(), crdv1.VirtualServiceCRD.Plural, v.namespace, fields.Everything()) - sw := cache.NewSharedInformer(lw, new(crdv1.VirtualService), v.syncFrequency) +func (u *virtualServicesClient) Watch(handlers ...storage.VirtualServiceEventHandler) (*storage.Watcher, error) { + lw := cache.NewListWatchFromClient(u.crds.GlooV1().RESTClient(), crdv1.VirtualServiceCRD.Plural, u.namespace, fields.Everything()) + sw := cache.NewSharedInformer(lw, new(crdv1.VirtualService), u.syncFrequency) for _, h := range handlers { sw.AddEventHandler(&virtualServiceEventHandler{handler: h, store: sw.GetStore()}) } @@ -76,41 +76,40 @@ func (v *virtualServicesClient) Watch(handlers ...storage.VirtualServiceEventHan }), nil } -func (v *virtualServicesClient) createOrUpdateVirtualServiceCrd(virtualService *v1.VirtualService, op crud.Operation) (*v1.VirtualService, error) { - vServiceCrd, err := VirtualServiceToCrd(v.namespace, virtualService) +func (c *virtualServicesClient) createOrUpdateVirtualServiceCrd(virtualService *v1.VirtualService, op crud.Operation) (*v1.VirtualService, error) { + virtualServiceCrd, err := VirtualServiceToCrd(c.namespace, virtualService) if err != nil { return nil, errors.Wrap(err, "converting gloo object to crd") } - vServices := v.crds.GlooV1().VirtualServices(vServiceCrd.Namespace) + virtualServices := c.crds.GlooV1().VirtualServices(virtualServiceCrd.Namespace) var returnedCrd *crdv1.VirtualService switch op { case crud.OperationCreate: - returnedCrd, err = vServices.Create(vServiceCrd) + returnedCrd, err = virtualServices.Create(virtualServiceCrd) if err != nil { if kuberrs.IsAlreadyExists(err) { return nil, storage.NewAlreadyExistsErr(err) } - err = errors.Wrap(err, "kubernetes create api request") - return nil, err + return nil, errors.Wrap(err, "kubernetes create api request") } case crud.OperationUpdate: - // need to make sure we preserve labels and annotations - currentCrd, err := vServices.Get(vServiceCrd.Name, metav1.GetOptions{ResourceVersion: vServiceCrd.ResourceVersion}) + // need to make sure we preserve labels + currentCrd, err := virtualServices.Get(virtualServiceCrd.Name, metav1.GetOptions{ResourceVersion: virtualServiceCrd.ResourceVersion}) if err != nil { return nil, errors.Wrap(err, "kubernetes get api request") } // copy labels - vServiceCrd.Labels = currentCrd.Labels - returnedCrd, err = vServices.Update(vServiceCrd) + virtualServiceCrd.Labels = currentCrd.Labels + returnedCrd, err = virtualServices.Update(virtualServiceCrd) if err != nil { return nil, errors.Wrap(err, "kubernetes update api request") } } - returnedvService, err := VirtualServiceFromCrd(returnedCrd) + returnedVirtualService, err := VirtualServiceFromCrd(returnedCrd) if err != nil { return nil, errors.Wrap(err, "converting returned crd to virtualService") } - return returnedvService, nil + return returnedVirtualService, nil } // implements the kubernetes ResourceEventHandler interface @@ -123,11 +122,11 @@ func (eh *virtualServiceEventHandler) getUpdatedList() []*v1.VirtualService { updatedList := eh.store.List() var updatedVirtualServiceList []*v1.VirtualService for _, updated := range updatedList { - vsCrd, ok := updated.(*crdv1.VirtualService) + virtualServiceCrd, ok := updated.(*crdv1.VirtualService) if !ok { continue } - updatedVirtualService, err := VirtualServiceFromCrd(vsCrd) + updatedVirtualService, err := VirtualServiceFromCrd(virtualServiceCrd) if err != nil { continue } @@ -136,37 +135,37 @@ func (eh *virtualServiceEventHandler) getUpdatedList() []*v1.VirtualService { return updatedVirtualServiceList } -func convertVh(obj interface{}) (*v1.VirtualService, bool) { - vsCrd, ok := obj.(*crdv1.VirtualService) +func convertVirtualService(obj interface{}) (*v1.VirtualService, bool) { + virtualServiceCrd, ok := obj.(*crdv1.VirtualService) if !ok { - return nil, false + return nil, ok } - vs, err := VirtualServiceFromCrd(vsCrd) + virtualService, err := VirtualServiceFromCrd(virtualServiceCrd) if err != nil { return nil, false } - return vs, ok + return virtualService, ok } func (eh *virtualServiceEventHandler) OnAdd(obj interface{}) { - vs, ok := convertVh(obj) + virtualService, ok := convertVirtualService(obj) if !ok { return } - eh.handler.OnAdd(eh.getUpdatedList(), vs) + eh.handler.OnAdd(eh.getUpdatedList(), virtualService) } func (eh *virtualServiceEventHandler) OnUpdate(_, newObj interface{}) { - newVh, ok := convertVh(newObj) + newVirtualService, ok := convertVirtualService(newObj) if !ok { return } - eh.handler.OnUpdate(eh.getUpdatedList(), newVh) + eh.handler.OnUpdate(eh.getUpdatedList(), newVirtualService) } func (eh *virtualServiceEventHandler) OnDelete(obj interface{}) { - vs, ok := convertVh(obj) + virtualService, ok := convertVirtualService(obj) if !ok { return } - eh.handler.OnDelete(eh.getUpdatedList(), vs) + eh.handler.OnDelete(eh.getUpdatedList(), virtualService) } From a13b65eb5aa0c0d161166378bc964d5603498b59 Mon Sep 17 00:00:00 2001 From: Scott Weiss Date: Mon, 30 Apr 2018 15:37:50 -0400 Subject: [PATCH 2/3] rerun generated code because why not Signed-off-by: Scott Weiss --- Makefile | 2 +- .../grpc/annotations.google.descriptor.go | 2 +- .../grpc/descriptors.google.descriptor.go | 2 +- pkg/plugins/grpc/http.google.descriptor.go | 2 +- .../bookstore/protos/bookstore.pb.go | 82 +++++++++--------- .../grpc-test-service/descriptors/proto.pb | Bin 70006 -> 71064 bytes .../containers/grpc-test-service/main.go | 2 +- .../glootest/protos/glootest.pb.go | 24 +++-- .../test_grpc_service/testgrpcservice.go | 2 +- 9 files changed, 57 insertions(+), 61 deletions(-) diff --git a/Makefile b/Makefile index 58b401f222e..90079973f45 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ generated-code: $(OUTPUT): mkdir -p $(OUTPUT) - + define BINARY_TARGETS $(eval VERSION := $(shell cat cmd/$(BINARY)/version)) $(eval IMAGE_TAG ?= $(VERSION)) diff --git a/pkg/plugins/grpc/annotations.google.descriptor.go b/pkg/plugins/grpc/annotations.google.descriptor.go index 724d82ad53f..a12f724665c 100644 --- a/pkg/plugins/grpc/annotations.google.descriptor.go +++ b/pkg/plugins/grpc/annotations.google.descriptor.go @@ -1,5 +1,5 @@ // File generated by 2gobytes v0.4.2 (http://github.com/paulvollmer/2gobytes) -// date: 2018-03-26 17:11:23.759194828 -0400 EDT m=+0.003949926 +// date: 2018-04-30 15:35:58.274663731 -0400 EDT m=+0.004028854 package grpc diff --git a/pkg/plugins/grpc/descriptors.google.descriptor.go b/pkg/plugins/grpc/descriptors.google.descriptor.go index ea89865f56b..6eb2848454d 100644 --- a/pkg/plugins/grpc/descriptors.google.descriptor.go +++ b/pkg/plugins/grpc/descriptors.google.descriptor.go @@ -1,5 +1,5 @@ // File generated by 2gobytes v0.4.2 (http://github.com/paulvollmer/2gobytes) -// date: 2018-03-26 17:11:24.473888857 -0400 EDT m=+0.640458305 +// date: 2018-04-30 15:35:59.244912996 -0400 EDT m=+0.887079990 package grpc diff --git a/pkg/plugins/grpc/http.google.descriptor.go b/pkg/plugins/grpc/http.google.descriptor.go index a974f9fd15f..19f54e91c0c 100644 --- a/pkg/plugins/grpc/http.google.descriptor.go +++ b/pkg/plugins/grpc/http.google.descriptor.go @@ -1,5 +1,5 @@ // File generated by 2gobytes v0.4.2 (http://github.com/paulvollmer/2gobytes) -// date: 2018-03-26 17:11:23.830848683 -0400 EDT m=+0.070306137 +// date: 2018-04-30 15:35:58.355959251 -0400 EDT m=+0.079986258 package grpc diff --git a/test/kube_e2e/containers/grpc-test-service/bookstore/protos/bookstore.pb.go b/test/kube_e2e/containers/grpc-test-service/bookstore/protos/bookstore.pb.go index 3964b97d4c6..b6fa8dfc59b 100644 --- a/test/kube_e2e/containers/grpc-test-service/bookstore/protos/bookstore.pb.go +++ b/test/kube_e2e/containers/grpc-test-service/bookstore/protos/bookstore.pb.go @@ -1,4 +1,4 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. +// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: protos/bookstore.proto /* @@ -24,16 +24,14 @@ It has these top-level messages: */ package bookstore -import proto "github.com/golang/protobuf/proto" +import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" import _ "google.golang.org/genproto/googleapis/api/annotations" import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) +import context "golang.org/x/net/context" +import grpc "google.golang.org/grpc" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -44,7 +42,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type Author_Gender int32 @@ -68,20 +66,20 @@ var Author_Gender_value = map[string]int32{ func (x Author_Gender) String() string { return proto.EnumName(Author_Gender_name, int32(x)) } -func (Author_Gender) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } +func (Author_Gender) EnumDescriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{2, 0} } // A shelf resource. type Shelf struct { // A unique shelf id. - Id int64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // A theme of the shelf (fiction, poetry, etc). - Theme string `protobuf:"bytes,2,opt,name=theme" json:"theme,omitempty"` + Theme string `protobuf:"bytes,2,opt,name=theme,proto3" json:"theme,omitempty"` } func (m *Shelf) Reset() { *m = Shelf{} } func (m *Shelf) String() string { return proto.CompactTextString(m) } func (*Shelf) ProtoMessage() {} -func (*Shelf) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (*Shelf) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{0} } func (m *Shelf) GetId() int64 { if m != nil { @@ -100,11 +98,11 @@ func (m *Shelf) GetTheme() string { // A book resource. type Book struct { // A unique book id. - Id int64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // An author of the book. - Author string `protobuf:"bytes,2,opt,name=author" json:"author,omitempty"` + Author string `protobuf:"bytes,2,opt,name=author,proto3" json:"author,omitempty"` // A book title. - Title string `protobuf:"bytes,3,opt,name=title" json:"title,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` // Quotes from the book. Quotes []string `protobuf:"bytes,4,rep,name=quotes" json:"quotes,omitempty"` } @@ -112,7 +110,7 @@ type Book struct { func (m *Book) Reset() { *m = Book{} } func (m *Book) String() string { return proto.CompactTextString(m) } func (*Book) ProtoMessage() {} -func (*Book) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (*Book) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{1} } func (m *Book) GetId() int64 { if m != nil { @@ -145,16 +143,16 @@ func (m *Book) GetQuotes() []string { // An author resource. type Author struct { // A unique author id. - Id int64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Gender Author_Gender `protobuf:"varint,2,opt,name=gender,enum=bookstore.Author_Gender" json:"gender,omitempty"` - FirstName string `protobuf:"bytes,3,opt,name=first_name,json=firstName" json:"first_name,omitempty"` - LastName string `protobuf:"bytes,4,opt,name=last_name,json=lname" json:"last_name,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Gender Author_Gender `protobuf:"varint,2,opt,name=gender,proto3,enum=bookstore.Author_Gender" json:"gender,omitempty"` + FirstName string `protobuf:"bytes,3,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` + LastName string `protobuf:"bytes,4,opt,name=last_name,json=lname,proto3" json:"last_name,omitempty"` } func (m *Author) Reset() { *m = Author{} } func (m *Author) String() string { return proto.CompactTextString(m) } func (*Author) ProtoMessage() {} -func (*Author) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (*Author) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{2} } func (m *Author) GetId() int64 { if m != nil { @@ -193,7 +191,7 @@ type ListShelvesResponse struct { func (m *ListShelvesResponse) Reset() { *m = ListShelvesResponse{} } func (m *ListShelvesResponse) String() string { return proto.CompactTextString(m) } func (*ListShelvesResponse) ProtoMessage() {} -func (*ListShelvesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } +func (*ListShelvesResponse) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{3} } func (m *ListShelvesResponse) GetShelves() []*Shelf { if m != nil { @@ -211,7 +209,7 @@ type CreateShelfRequest struct { func (m *CreateShelfRequest) Reset() { *m = CreateShelfRequest{} } func (m *CreateShelfRequest) String() string { return proto.CompactTextString(m) } func (*CreateShelfRequest) ProtoMessage() {} -func (*CreateShelfRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } +func (*CreateShelfRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{4} } func (m *CreateShelfRequest) GetShelf() *Shelf { if m != nil { @@ -223,13 +221,13 @@ func (m *CreateShelfRequest) GetShelf() *Shelf { // Request message for GetShelf method. type GetShelfRequest struct { // The ID of the shelf resource to retrieve. - Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"` + Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` } func (m *GetShelfRequest) Reset() { *m = GetShelfRequest{} } func (m *GetShelfRequest) String() string { return proto.CompactTextString(m) } func (*GetShelfRequest) ProtoMessage() {} -func (*GetShelfRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } +func (*GetShelfRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{5} } func (m *GetShelfRequest) GetShelf() int64 { if m != nil { @@ -241,13 +239,13 @@ func (m *GetShelfRequest) GetShelf() int64 { // Request message for DeleteShelf method. type DeleteShelfRequest struct { // The ID of the shelf to delete. - Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"` + Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` } func (m *DeleteShelfRequest) Reset() { *m = DeleteShelfRequest{} } func (m *DeleteShelfRequest) String() string { return proto.CompactTextString(m) } func (*DeleteShelfRequest) ProtoMessage() {} -func (*DeleteShelfRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } +func (*DeleteShelfRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{6} } func (m *DeleteShelfRequest) GetShelf() int64 { if m != nil { @@ -259,13 +257,13 @@ func (m *DeleteShelfRequest) GetShelf() int64 { // Request message for ListBooks method. type ListBooksRequest struct { // ID of the shelf which books to list. - Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"` + Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` } func (m *ListBooksRequest) Reset() { *m = ListBooksRequest{} } func (m *ListBooksRequest) String() string { return proto.CompactTextString(m) } func (*ListBooksRequest) ProtoMessage() {} -func (*ListBooksRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } +func (*ListBooksRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{7} } func (m *ListBooksRequest) GetShelf() int64 { if m != nil { @@ -277,7 +275,7 @@ func (m *ListBooksRequest) GetShelf() int64 { // Request message for CreateBook method. type CreateBookRequest struct { // The ID of the shelf on which to create a book. - Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"` + Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` // A book resource to create on the shelf. Book *Book `protobuf:"bytes,2,opt,name=book" json:"book,omitempty"` } @@ -285,7 +283,7 @@ type CreateBookRequest struct { func (m *CreateBookRequest) Reset() { *m = CreateBookRequest{} } func (m *CreateBookRequest) String() string { return proto.CompactTextString(m) } func (*CreateBookRequest) ProtoMessage() {} -func (*CreateBookRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } +func (*CreateBookRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{8} } func (m *CreateBookRequest) GetShelf() int64 { if m != nil { @@ -304,15 +302,15 @@ func (m *CreateBookRequest) GetBook() *Book { // Request message for GetBook method. type GetBookRequest struct { // The ID of the shelf from which to retrieve a book. - Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"` + Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` // The ID of the book to retrieve. - Book int64 `protobuf:"varint,2,opt,name=book" json:"book,omitempty"` + Book int64 `protobuf:"varint,2,opt,name=book,proto3" json:"book,omitempty"` } func (m *GetBookRequest) Reset() { *m = GetBookRequest{} } func (m *GetBookRequest) String() string { return proto.CompactTextString(m) } func (*GetBookRequest) ProtoMessage() {} -func (*GetBookRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } +func (*GetBookRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{9} } func (m *GetBookRequest) GetShelf() int64 { if m != nil { @@ -331,7 +329,7 @@ func (m *GetBookRequest) GetBook() int64 { // Request message for UpdateBook method type UpdateBookRequest struct { // The ID of the shelf from which to retrieve a book. - Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"` + Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` // A book resource to update on the shelf. Book *Book `protobuf:"bytes,2,opt,name=book" json:"book,omitempty"` } @@ -339,7 +337,7 @@ type UpdateBookRequest struct { func (m *UpdateBookRequest) Reset() { *m = UpdateBookRequest{} } func (m *UpdateBookRequest) String() string { return proto.CompactTextString(m) } func (*UpdateBookRequest) ProtoMessage() {} -func (*UpdateBookRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } +func (*UpdateBookRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{10} } func (m *UpdateBookRequest) GetShelf() int64 { if m != nil { @@ -358,15 +356,15 @@ func (m *UpdateBookRequest) GetBook() *Book { // Request message for DeleteBook method. type DeleteBookRequest struct { // The ID of the shelf from which to delete a book. - Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"` + Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` // The ID of the book to delete. - Book int64 `protobuf:"varint,2,opt,name=book" json:"book,omitempty"` + Book int64 `protobuf:"varint,2,opt,name=book,proto3" json:"book,omitempty"` } func (m *DeleteBookRequest) Reset() { *m = DeleteBookRequest{} } func (m *DeleteBookRequest) String() string { return proto.CompactTextString(m) } func (*DeleteBookRequest) ProtoMessage() {} -func (*DeleteBookRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } +func (*DeleteBookRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{11} } func (m *DeleteBookRequest) GetShelf() int64 { if m != nil { @@ -385,13 +383,13 @@ func (m *DeleteBookRequest) GetBook() int64 { // Request message for GetAuthor method. type GetAuthorRequest struct { // The ID of the author resource to retrieve. - Author int64 `protobuf:"varint,1,opt,name=author" json:"author,omitempty"` + Author int64 `protobuf:"varint,1,opt,name=author,proto3" json:"author,omitempty"` } func (m *GetAuthorRequest) Reset() { *m = GetAuthorRequest{} } func (m *GetAuthorRequest) String() string { return proto.CompactTextString(m) } func (*GetAuthorRequest) ProtoMessage() {} -func (*GetAuthorRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } +func (*GetAuthorRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{12} } func (m *GetAuthorRequest) GetAuthor() int64 { if m != nil { @@ -932,9 +930,9 @@ var _Bookstore_serviceDesc = grpc.ServiceDesc{ Metadata: "protos/bookstore.proto", } -func init() { proto.RegisterFile("protos/bookstore.proto", fileDescriptor0) } +func init() { proto.RegisterFile("protos/bookstore.proto", fileDescriptorBookstore) } -var fileDescriptor0 = []byte{ +var fileDescriptorBookstore = []byte{ // 776 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xdd, 0x6e, 0xda, 0x4a, 0x10, 0x8e, 0x81, 0xf0, 0x33, 0xe8, 0x04, 0x33, 0xc9, 0x41, 0x8e, 0x13, 0x72, 0xd0, 0xe6, 0x9c, diff --git a/test/kube_e2e/containers/grpc-test-service/descriptors/proto.pb b/test/kube_e2e/containers/grpc-test-service/descriptors/proto.pb index 186dc3a1c997a120d312f2e28bd28990f93f4156..8501672e80f9fa48d444c84cd8c0213e0d13579a 100644 GIT binary patch delta 14072 zcmZ`=d3aUTwa?jS$i3%gxH&-r37A6|5@s2yD4+sH83d`pVgXHW$PEdGB<3az{p>sH z!)l%7P{ZKIAV%vGKd2YV_k18~MWj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EAg5zbXKN_!SFZ73k3I(&E@_@pfAtx`83R*TNEc zAPe~nOk;GX_jRo@Qr(uyV$lrqyDj`!iE>snK(pKG+dpi;NZl5`oCgx99o^R83a~p; zMf^e;Z9~ePzD_J`LynbuyL?3g_HifV7LESccI&D4KH`PxH25}98G6^ zFpH&*W*Sb(el*i?szpaL4X1=ZnrS%g=tnaRXVUPanTCrt7>>r!aM6elqiFU&{jgt| z=+v%?PB9kD-kGD!2F1Gc;KOBhYMq@CZ(3RFY*mRU-n6#X*@eS{@X~TxXJd6yB_avn z^|m=O5TFHy23d)O065oYa?&DOZx@ydl|~^VNbs{uO$v@jZF77;N^1=bAt|l4M>9!j zy*+9djtN!3`KW!_<#Z?KW?$ES%#QrpANOBh^?A(3ueyJN#OzBUd)y!O*}Xr0+*WG_ zZOH7$?HHyXr4A6pkK6s^mnA^ZK5pa75@mK@%IqyRe@ zGEqVA%w(c$>$LIvM$JS;y)*sNpMPl?FZFZ$73T)~%T5hqZT^N+(+&Dphfhw8%DzyD zA3&RzMkc1+FTcx5W&Afo+4ugNq3rwr%|I~ozZnRJ|IJVq{5L~+ME~yuenUw>{TBj$ za9o~6yDI&E1U~ain3od&AR&GQAo`Uweur8<$W#9yQ4uMopQl0(%><+new}AjWYLdG xh!S7TC6q>rZ|b633FB9r6-Adi7dVy-Bqv7li}1Kwo!;};WsFTsk3Uye{C}DVl}-Qv diff --git a/test/kube_e2e/containers/grpc-test-service/main.go b/test/kube_e2e/containers/grpc-test-service/main.go index 15a5312f05d..c49344eea8f 100644 --- a/test/kube_e2e/containers/grpc-test-service/main.go +++ b/test/kube_e2e/containers/grpc-test-service/main.go @@ -20,7 +20,7 @@ import ( //go:generate mkdir -p bookstore //go:generate mkdir -p descriptors -//go:generate protoc -I${HOME}/workspace/googleapis -I. --include_source_info --go_out=plugins=grpc:bookstore --include_imports --descriptor_set_out=descriptors/proto.pb protos/bookstore.proto +//go:generate protoc -I${HOME}/workspace/googleapis -I. --include_source_info --gogo_out=plugins=grpc:bookstore --include_imports --descriptor_set_out=descriptors/proto.pb protos/bookstore.proto func main() { port := flag.Int("p", 8080, "port") diff --git a/test/local_e2e/test_grpc_service/glootest/protos/glootest.pb.go b/test/local_e2e/test_grpc_service/glootest/protos/glootest.pb.go index b6038d11251..23ac5213b09 100644 --- a/test/local_e2e/test_grpc_service/glootest/protos/glootest.pb.go +++ b/test/local_e2e/test_grpc_service/glootest/protos/glootest.pb.go @@ -1,4 +1,4 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. +// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: protos/glootest.proto /* @@ -13,14 +13,12 @@ It has these top-level messages: */ package glootest -import proto "github.com/golang/protobuf/proto" +import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) +import context "golang.org/x/net/context" +import grpc "google.golang.org/grpc" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -31,16 +29,16 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type TestRequest struct { - Str string `protobuf:"bytes,1,opt,name=str" json:"str,omitempty"` + Str string `protobuf:"bytes,1,opt,name=str,proto3" json:"str,omitempty"` } func (m *TestRequest) Reset() { *m = TestRequest{} } func (m *TestRequest) String() string { return proto.CompactTextString(m) } func (*TestRequest) ProtoMessage() {} -func (*TestRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (*TestRequest) Descriptor() ([]byte, []int) { return fileDescriptorGlootest, []int{0} } func (m *TestRequest) GetStr() string { if m != nil { @@ -50,13 +48,13 @@ func (m *TestRequest) GetStr() string { } type TestResponse struct { - Str string `protobuf:"bytes,1,opt,name=str" json:"str,omitempty"` + Str string `protobuf:"bytes,1,opt,name=str,proto3" json:"str,omitempty"` } func (m *TestResponse) Reset() { *m = TestResponse{} } func (m *TestResponse) String() string { return proto.CompactTextString(m) } func (*TestResponse) ProtoMessage() {} -func (*TestResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (*TestResponse) Descriptor() ([]byte, []int) { return fileDescriptorGlootest, []int{1} } func (m *TestResponse) GetStr() string { if m != nil { @@ -142,9 +140,9 @@ var _TestService_serviceDesc = grpc.ServiceDesc{ Metadata: "protos/glootest.proto", } -func init() { proto.RegisterFile("protos/glootest.proto", fileDescriptor0) } +func init() { proto.RegisterFile("protos/glootest.proto", fileDescriptorGlootest) } -var fileDescriptor0 = []byte{ +var fileDescriptorGlootest = []byte{ // 136 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2d, 0x28, 0xca, 0x2f, 0xc9, 0x2f, 0xd6, 0x4f, 0xcf, 0xc9, 0xcf, 0x2f, 0x49, 0x2d, 0x2e, 0xd1, 0x03, 0xf3, 0x85, 0x38, diff --git a/test/local_e2e/test_grpc_service/testgrpcservice.go b/test/local_e2e/test_grpc_service/testgrpcservice.go index a22239e94b3..e7ae19e89a7 100644 --- a/test/local_e2e/test_grpc_service/testgrpcservice.go +++ b/test/local_e2e/test_grpc_service/testgrpcservice.go @@ -13,7 +13,7 @@ import ( //go:generate mkdir -p glootest //go:generate mkdir -p descriptors -//go:generate protoc -I. --go_out=plugins=grpc:glootest --descriptor_set_out=descriptors/proto.pb protos/glootest.proto +//go:generate protoc -I. --gogo_out=plugins=grpc:glootest --descriptor_set_out=descriptors/proto.pb protos/glootest.proto func RunServer() *TestGRPCServer { lis, err := net.Listen("tcp", ":0") From 394d2f5fd45249c8afbf614cbec5861a82d56481 Mon Sep 17 00:00:00 2001 From: Scott Weiss Date: Mon, 30 Apr 2018 19:53:30 -0400 Subject: [PATCH 3/3] have to use golang/protobuf to generate Signed-off-by: Scott Weiss --- .../bookstore/protos/bookstore.pb.go | 82 ++++++++++--------- .../containers/grpc-test-service/main.go | 2 +- 2 files changed, 43 insertions(+), 41 deletions(-) diff --git a/test/kube_e2e/containers/grpc-test-service/bookstore/protos/bookstore.pb.go b/test/kube_e2e/containers/grpc-test-service/bookstore/protos/bookstore.pb.go index b6fa8dfc59b..3964b97d4c6 100644 --- a/test/kube_e2e/containers/grpc-test-service/bookstore/protos/bookstore.pb.go +++ b/test/kube_e2e/containers/grpc-test-service/bookstore/protos/bookstore.pb.go @@ -1,4 +1,4 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: protos/bookstore.proto /* @@ -24,14 +24,16 @@ It has these top-level messages: */ package bookstore -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import _ "google.golang.org/genproto/googleapis/api/annotations" import google_protobuf1 "github.com/golang/protobuf/ptypes/empty" -import context "golang.org/x/net/context" -import grpc "google.golang.org/grpc" +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -42,7 +44,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type Author_Gender int32 @@ -66,20 +68,20 @@ var Author_Gender_value = map[string]int32{ func (x Author_Gender) String() string { return proto.EnumName(Author_Gender_name, int32(x)) } -func (Author_Gender) EnumDescriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{2, 0} } +func (Author_Gender) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } // A shelf resource. type Shelf struct { // A unique shelf id. - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` // A theme of the shelf (fiction, poetry, etc). - Theme string `protobuf:"bytes,2,opt,name=theme,proto3" json:"theme,omitempty"` + Theme string `protobuf:"bytes,2,opt,name=theme" json:"theme,omitempty"` } func (m *Shelf) Reset() { *m = Shelf{} } func (m *Shelf) String() string { return proto.CompactTextString(m) } func (*Shelf) ProtoMessage() {} -func (*Shelf) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{0} } +func (*Shelf) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } func (m *Shelf) GetId() int64 { if m != nil { @@ -98,11 +100,11 @@ func (m *Shelf) GetTheme() string { // A book resource. type Book struct { // A unique book id. - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` // An author of the book. - Author string `protobuf:"bytes,2,opt,name=author,proto3" json:"author,omitempty"` + Author string `protobuf:"bytes,2,opt,name=author" json:"author,omitempty"` // A book title. - Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title" json:"title,omitempty"` // Quotes from the book. Quotes []string `protobuf:"bytes,4,rep,name=quotes" json:"quotes,omitempty"` } @@ -110,7 +112,7 @@ type Book struct { func (m *Book) Reset() { *m = Book{} } func (m *Book) String() string { return proto.CompactTextString(m) } func (*Book) ProtoMessage() {} -func (*Book) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{1} } +func (*Book) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func (m *Book) GetId() int64 { if m != nil { @@ -143,16 +145,16 @@ func (m *Book) GetQuotes() []string { // An author resource. type Author struct { // A unique author id. - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Gender Author_Gender `protobuf:"varint,2,opt,name=gender,proto3,enum=bookstore.Author_Gender" json:"gender,omitempty"` - FirstName string `protobuf:"bytes,3,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` - LastName string `protobuf:"bytes,4,opt,name=last_name,json=lname,proto3" json:"last_name,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Gender Author_Gender `protobuf:"varint,2,opt,name=gender,enum=bookstore.Author_Gender" json:"gender,omitempty"` + FirstName string `protobuf:"bytes,3,opt,name=first_name,json=firstName" json:"first_name,omitempty"` + LastName string `protobuf:"bytes,4,opt,name=last_name,json=lname" json:"last_name,omitempty"` } func (m *Author) Reset() { *m = Author{} } func (m *Author) String() string { return proto.CompactTextString(m) } func (*Author) ProtoMessage() {} -func (*Author) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{2} } +func (*Author) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } func (m *Author) GetId() int64 { if m != nil { @@ -191,7 +193,7 @@ type ListShelvesResponse struct { func (m *ListShelvesResponse) Reset() { *m = ListShelvesResponse{} } func (m *ListShelvesResponse) String() string { return proto.CompactTextString(m) } func (*ListShelvesResponse) ProtoMessage() {} -func (*ListShelvesResponse) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{3} } +func (*ListShelvesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } func (m *ListShelvesResponse) GetShelves() []*Shelf { if m != nil { @@ -209,7 +211,7 @@ type CreateShelfRequest struct { func (m *CreateShelfRequest) Reset() { *m = CreateShelfRequest{} } func (m *CreateShelfRequest) String() string { return proto.CompactTextString(m) } func (*CreateShelfRequest) ProtoMessage() {} -func (*CreateShelfRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{4} } +func (*CreateShelfRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } func (m *CreateShelfRequest) GetShelf() *Shelf { if m != nil { @@ -221,13 +223,13 @@ func (m *CreateShelfRequest) GetShelf() *Shelf { // Request message for GetShelf method. type GetShelfRequest struct { // The ID of the shelf resource to retrieve. - Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` + Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"` } func (m *GetShelfRequest) Reset() { *m = GetShelfRequest{} } func (m *GetShelfRequest) String() string { return proto.CompactTextString(m) } func (*GetShelfRequest) ProtoMessage() {} -func (*GetShelfRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{5} } +func (*GetShelfRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } func (m *GetShelfRequest) GetShelf() int64 { if m != nil { @@ -239,13 +241,13 @@ func (m *GetShelfRequest) GetShelf() int64 { // Request message for DeleteShelf method. type DeleteShelfRequest struct { // The ID of the shelf to delete. - Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` + Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"` } func (m *DeleteShelfRequest) Reset() { *m = DeleteShelfRequest{} } func (m *DeleteShelfRequest) String() string { return proto.CompactTextString(m) } func (*DeleteShelfRequest) ProtoMessage() {} -func (*DeleteShelfRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{6} } +func (*DeleteShelfRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } func (m *DeleteShelfRequest) GetShelf() int64 { if m != nil { @@ -257,13 +259,13 @@ func (m *DeleteShelfRequest) GetShelf() int64 { // Request message for ListBooks method. type ListBooksRequest struct { // ID of the shelf which books to list. - Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` + Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"` } func (m *ListBooksRequest) Reset() { *m = ListBooksRequest{} } func (m *ListBooksRequest) String() string { return proto.CompactTextString(m) } func (*ListBooksRequest) ProtoMessage() {} -func (*ListBooksRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{7} } +func (*ListBooksRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } func (m *ListBooksRequest) GetShelf() int64 { if m != nil { @@ -275,7 +277,7 @@ func (m *ListBooksRequest) GetShelf() int64 { // Request message for CreateBook method. type CreateBookRequest struct { // The ID of the shelf on which to create a book. - Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` + Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"` // A book resource to create on the shelf. Book *Book `protobuf:"bytes,2,opt,name=book" json:"book,omitempty"` } @@ -283,7 +285,7 @@ type CreateBookRequest struct { func (m *CreateBookRequest) Reset() { *m = CreateBookRequest{} } func (m *CreateBookRequest) String() string { return proto.CompactTextString(m) } func (*CreateBookRequest) ProtoMessage() {} -func (*CreateBookRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{8} } +func (*CreateBookRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } func (m *CreateBookRequest) GetShelf() int64 { if m != nil { @@ -302,15 +304,15 @@ func (m *CreateBookRequest) GetBook() *Book { // Request message for GetBook method. type GetBookRequest struct { // The ID of the shelf from which to retrieve a book. - Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` + Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"` // The ID of the book to retrieve. - Book int64 `protobuf:"varint,2,opt,name=book,proto3" json:"book,omitempty"` + Book int64 `protobuf:"varint,2,opt,name=book" json:"book,omitempty"` } func (m *GetBookRequest) Reset() { *m = GetBookRequest{} } func (m *GetBookRequest) String() string { return proto.CompactTextString(m) } func (*GetBookRequest) ProtoMessage() {} -func (*GetBookRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{9} } +func (*GetBookRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } func (m *GetBookRequest) GetShelf() int64 { if m != nil { @@ -329,7 +331,7 @@ func (m *GetBookRequest) GetBook() int64 { // Request message for UpdateBook method type UpdateBookRequest struct { // The ID of the shelf from which to retrieve a book. - Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` + Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"` // A book resource to update on the shelf. Book *Book `protobuf:"bytes,2,opt,name=book" json:"book,omitempty"` } @@ -337,7 +339,7 @@ type UpdateBookRequest struct { func (m *UpdateBookRequest) Reset() { *m = UpdateBookRequest{} } func (m *UpdateBookRequest) String() string { return proto.CompactTextString(m) } func (*UpdateBookRequest) ProtoMessage() {} -func (*UpdateBookRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{10} } +func (*UpdateBookRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } func (m *UpdateBookRequest) GetShelf() int64 { if m != nil { @@ -356,15 +358,15 @@ func (m *UpdateBookRequest) GetBook() *Book { // Request message for DeleteBook method. type DeleteBookRequest struct { // The ID of the shelf from which to delete a book. - Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` + Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"` // The ID of the book to delete. - Book int64 `protobuf:"varint,2,opt,name=book,proto3" json:"book,omitempty"` + Book int64 `protobuf:"varint,2,opt,name=book" json:"book,omitempty"` } func (m *DeleteBookRequest) Reset() { *m = DeleteBookRequest{} } func (m *DeleteBookRequest) String() string { return proto.CompactTextString(m) } func (*DeleteBookRequest) ProtoMessage() {} -func (*DeleteBookRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{11} } +func (*DeleteBookRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } func (m *DeleteBookRequest) GetShelf() int64 { if m != nil { @@ -383,13 +385,13 @@ func (m *DeleteBookRequest) GetBook() int64 { // Request message for GetAuthor method. type GetAuthorRequest struct { // The ID of the author resource to retrieve. - Author int64 `protobuf:"varint,1,opt,name=author,proto3" json:"author,omitempty"` + Author int64 `protobuf:"varint,1,opt,name=author" json:"author,omitempty"` } func (m *GetAuthorRequest) Reset() { *m = GetAuthorRequest{} } func (m *GetAuthorRequest) String() string { return proto.CompactTextString(m) } func (*GetAuthorRequest) ProtoMessage() {} -func (*GetAuthorRequest) Descriptor() ([]byte, []int) { return fileDescriptorBookstore, []int{12} } +func (*GetAuthorRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } func (m *GetAuthorRequest) GetAuthor() int64 { if m != nil { @@ -930,9 +932,9 @@ var _Bookstore_serviceDesc = grpc.ServiceDesc{ Metadata: "protos/bookstore.proto", } -func init() { proto.RegisterFile("protos/bookstore.proto", fileDescriptorBookstore) } +func init() { proto.RegisterFile("protos/bookstore.proto", fileDescriptor0) } -var fileDescriptorBookstore = []byte{ +var fileDescriptor0 = []byte{ // 776 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xdd, 0x6e, 0xda, 0x4a, 0x10, 0x8e, 0x81, 0xf0, 0x33, 0xe8, 0x04, 0x33, 0xc9, 0x41, 0x8e, 0x13, 0x72, 0xd0, 0xe6, 0x9c, diff --git a/test/kube_e2e/containers/grpc-test-service/main.go b/test/kube_e2e/containers/grpc-test-service/main.go index c49344eea8f..15a5312f05d 100644 --- a/test/kube_e2e/containers/grpc-test-service/main.go +++ b/test/kube_e2e/containers/grpc-test-service/main.go @@ -20,7 +20,7 @@ import ( //go:generate mkdir -p bookstore //go:generate mkdir -p descriptors -//go:generate protoc -I${HOME}/workspace/googleapis -I. --include_source_info --gogo_out=plugins=grpc:bookstore --include_imports --descriptor_set_out=descriptors/proto.pb protos/bookstore.proto +//go:generate protoc -I${HOME}/workspace/googleapis -I. --include_source_info --go_out=plugins=grpc:bookstore --include_imports --descriptor_set_out=descriptors/proto.pb protos/bookstore.proto func main() { port := flag.Int("p", 8080, "port")