From 26b6e6274ecbc30269b4272ce7dbfcad4b447375 Mon Sep 17 00:00:00 2001 From: Kavindu Dodanduwa Date: Wed, 1 Feb 2023 15:47:55 -0800 Subject: [PATCH] cleanup schema from local Signed-off-by: Kavindu Dodanduwa --- go.mod | 4 +-- go.sum | 28 +++------------------ pkg/sync/grpc/grpc_sync.go | 7 +++--- schema/buf.gen.yaml | 8 ------ schema/buf.yaml | 9 ------- schema/sync/v1/flags.proto | 51 -------------------------------------- 6 files changed, 10 insertions(+), 97 deletions(-) delete mode 100644 schema/buf.gen.yaml delete mode 100644 schema/buf.yaml delete mode 100644 schema/sync/v1/flags.proto diff --git a/go.mod b/go.mod index e7fdb3d63..e26b98411 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/open-feature/flagd go 1.19 require ( - buf.build/gen/go/kavindudodan/flagd/grpc/go v1.2.0-20230123231905-11466466f72d.4 - buf.build/gen/go/kavindudodan/flagd/protocolbuffers/go v1.28.1-20230123231905-11466466f72d.4 + buf.build/gen/go/kavindudodan/flagd/grpc/go v1.2.0-20230201231859-0ba584642f5c.4 + buf.build/gen/go/kavindudodan/flagd/protocolbuffers/go v1.28.1-20230201231859-0ba584642f5c.4 buf.build/gen/go/open-feature/flagd/bufbuild/connect-go v1.4.1-20221226184428-0dc62ff103b8.1 buf.build/gen/go/open-feature/flagd/grpc/go v1.2.0-20221226184428-0dc62ff103b8.4 buf.build/gen/go/open-feature/flagd/protocolbuffers/go v1.28.1-20221226184428-0dc62ff103b8.4 diff --git a/go.sum b/go.sum index de33bd367..1fb2c0991 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,9 @@ buf.build/gen/go/grpc-ecosystem/grpc-gateway/grpc/go v1.2.0-20220906183531-bc28b723cd77.4/go.mod h1:hAKk3I2AivrJgMLXjDGrfzRx2NVWQgEPNfr4Co9DLX4= buf.build/gen/go/grpc-ecosystem/grpc-gateway/protocolbuffers/go v1.28.1-20220906183531-bc28b723cd77.4/go.mod h1:92ejKVTiuvnKoAtRlpJpIxKfloI935DDqhs0NCRx+KM= -buf.build/gen/go/kavindudodan/flagd/grpc/go v1.2.0-20230123231905-11466466f72d.4 h1:1fQv2ozb/dr74S3CPIGZunSndVzHAPeY5niWnEr0xDg= -buf.build/gen/go/kavindudodan/flagd/grpc/go v1.2.0-20230123231905-11466466f72d.4/go.mod h1:HhDGIP35zh2M82Dx4oIzit5ZEtoOaOyy35dAr/e+Uuo= -buf.build/gen/go/kavindudodan/flagd/protocolbuffers/go v1.28.1-20230123231905-11466466f72d.4 h1:uZNmxfZMZVrfd31Iz4YQsRa6zl4kifKUwRWjtIMz8yI= -buf.build/gen/go/kavindudodan/flagd/protocolbuffers/go v1.28.1-20230123231905-11466466f72d.4/go.mod h1:jpjQMBqnFcgHMK99ylFu+PhUhA1KD6AC1QSz27yC/1U= +buf.build/gen/go/kavindudodan/flagd/grpc/go v1.2.0-20230201231859-0ba584642f5c.4 h1:v19nAzB4Q4cSQq7PhmgeUPHQJYouc68caoBI/HdGw+k= +buf.build/gen/go/kavindudodan/flagd/grpc/go v1.2.0-20230201231859-0ba584642f5c.4/go.mod h1:GZ8j43uPGP/wa1L/z3q4hr5ur6hyG+WkXTtVEZqFBzs= +buf.build/gen/go/kavindudodan/flagd/protocolbuffers/go v1.28.1-20230201231859-0ba584642f5c.4 h1:TtrLf/K+yWLXk9ello83xaPD/WIZr0usxzAQdkHLyLo= +buf.build/gen/go/kavindudodan/flagd/protocolbuffers/go v1.28.1-20230201231859-0ba584642f5c.4/go.mod h1:jpjQMBqnFcgHMK99ylFu+PhUhA1KD6AC1QSz27yC/1U= buf.build/gen/go/open-feature/flagd/bufbuild/connect-go v1.4.1-20221226184428-0dc62ff103b8.1 h1:KoSPqmHyi3x27tPFLQ994CJjG4qc59v+0gbxY9+VXso= buf.build/gen/go/open-feature/flagd/bufbuild/connect-go v1.4.1-20221226184428-0dc62ff103b8.1/go.mod h1:68WGv4z/jXuTS3G7FEFQTEw4wiMmulBSX6BlSFX2Xc8= buf.build/gen/go/open-feature/flagd/grpc/go v1.2.0-20221226184428-0dc62ff103b8.4 h1:9ioWUVmnURL+TX4qVjyzzE3o9Z2ACDGidqtu9dkjmdY= @@ -61,8 +61,6 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bufbuild/connect-go v1.4.1 h1:6usL3JGjKhxQpvDlizP7u8VfjAr1JkckcAUbrdcbgNY= -github.com/bufbuild/connect-go v1.4.1/go.mod h1:9iNvh/NOsfhNBUH5CtvXeVUskQO1xsrEviH7ZArwZ3I= github.com/bufbuild/connect-go v1.5.0 h1:IfbgbzzaaZvF+OM3SfxO2EjtvNJarNAz2DIRuuNjAgc= github.com/bufbuild/connect-go v1.5.0/go.mod h1:9iNvh/NOsfhNBUH5CtvXeVUskQO1xsrEviH7ZArwZ3I= github.com/bufbuild/connect-go v1.5.1 h1:ORhrSiu63hWxtuMmC/V1mKySSRhEySsW5RkHJcyJXBk= @@ -287,14 +285,6 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo/v2 v2.6.0 h1:9t9b9vRUbFq3C4qKFCGkVuq/fIHji802N1nrtkh1mNc= github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E= -github.com/open-feature/open-feature-operator v0.2.24 h1:6UwfHO7pa2WDDpdyL+hzYwukbooAA2IZFgyj5xga2vw= -github.com/open-feature/open-feature-operator v0.2.24/go.mod h1:6zsu3m2sa8b4qJlHIAp1Kuc80mCAOAkBCkvDTTyv9ZY= -github.com/open-feature/open-feature-operator v0.2.25 h1:6X1dn7YTTCxRj7Sq6NR3ThDvXYt+4VPPC1GP7D5GD+Q= -github.com/open-feature/open-feature-operator v0.2.25/go.mod h1:8OFtVXXdVpZTSx1vHravbTYup4iyeb+PLmiKbRL11TA= -github.com/open-feature/open-feature-operator v0.2.26 h1:nv3Bln6Zvkc0fXz1/XpQR5TtiXn8KZ/9r85y/jWGNE0= -github.com/open-feature/open-feature-operator v0.2.26/go.mod h1:bQncVK7hvhj5QStPwexxQ1aArPwox2Y1vWrVei/qIFg= -github.com/open-feature/open-feature-operator v0.2.27 h1:OIPEVrEOK39mLeImKrcLnd1AVClj7VrEMOtnZjHLXxY= -github.com/open-feature/open-feature-operator v0.2.27/go.mod h1:bQncVK7hvhj5QStPwexxQ1aArPwox2Y1vWrVei/qIFg= github.com/open-feature/open-feature-operator v0.2.28 h1:qzzVq8v9G7aXO7luocO/wQCGnTJjtcQh75mDOqjnFxo= github.com/open-feature/open-feature-operator v0.2.28/go.mod h1:bQncVK7hvhj5QStPwexxQ1aArPwox2Y1vWrVei/qIFg= github.com/open-feature/schemas v0.2.8 h1:oA75hJXpOd9SFgmNI2IAxWZkwzQPUDm7Jyyh3q489wM= @@ -727,10 +717,6 @@ google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA5 google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk= -google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= -google.golang.org/grpc v1.52.1 h1:2NpOPk5g5Xtb0qebIEs7hNIa++PdtZLo2AQUpc1YnSU= -google.golang.org/grpc v1.52.1/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/grpc v1.52.3 h1:pf7sOysg4LdgBqduXveGKrcEwbStiK2rtfghdzlUYDQ= google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -781,16 +767,12 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.26.1 h1:f+SWYiPd/GsiWwVRz+NbFyCgvv75Pk9NK6dlkZgpCRQ= k8s.io/api v0.26.1/go.mod h1:xd/GBNgR0f707+ATNyPmQ1oyKSgndzXij81FzWGsejg= -k8s.io/apiextensions-apiserver v0.26.0 h1:Gy93Xo1eg2ZIkNX/8vy5xviVSxwQulsnUdQ00nEdpDo= -k8s.io/apiextensions-apiserver v0.26.0/go.mod h1:7ez0LTiyW5nq3vADtK6C3kMESxadD51Bh6uz3JOlqWQ= k8s.io/apiextensions-apiserver v0.26.1 h1:cB8h1SRk6e/+i3NOrQgSFij1B2S0Y0wDoNl66bn8RMI= k8s.io/apiextensions-apiserver v0.26.1/go.mod h1:AptjOSXDGuE0JICx/Em15PaoO7buLwTs0dGleIHixSM= k8s.io/apimachinery v0.26.1 h1:8EZ/eGJL+hY/MYCNwhmDzVqq2lPl3N3Bo8rvweJwXUQ= k8s.io/apimachinery v0.26.1/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= k8s.io/client-go v0.26.1 h1:87CXzYJnAMGaa/IDDfRdhTzxk/wzGZ+/HUQpqgVSZXU= k8s.io/client-go v0.26.1/go.mod h1:IWNSglg+rQ3OcvDkhY6+QLeasV4OYHDjdqeWkDQZwGE= -k8s.io/component-base v0.26.0 h1:0IkChOCohtDHttmKuz+EP3j3+qKmV55rM9gIFTXA7Vs= -k8s.io/component-base v0.26.0/go.mod h1:lqHwlfV1/haa14F/Z5Zizk5QmzaVf23nQzCwVOQpfC8= k8s.io/component-base v0.26.1 h1:4ahudpeQXHZL5kko+iDHqLj/FSGAEUnSVO0EBbgDd+4= k8s.io/component-base v0.26.1/go.mod h1:VHrLR0b58oC035w6YQiBSbtsf0ThuSwXP+p5dD/kAWU= k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= @@ -802,8 +784,6 @@ k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/controller-runtime v0.14.1 h1:vThDes9pzg0Y+UbCPY3Wj34CGIYPgdmspPm2GIpxpzM= -sigs.k8s.io/controller-runtime v0.14.1/go.mod h1:GaRkrY8a7UZF0kqFFbUKG7n9ICiTY5T55P1RiE3UZlU= sigs.k8s.io/controller-runtime v0.14.2 h1:P6IwDhbsRWsBClt/8/h8Zy36bCuGuW5Op7MHpFrN/60= sigs.k8s.io/controller-runtime v0.14.2/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0= sigs.k8s.io/controller-runtime v0.14.3 h1:F1JutCoGfSDRiayjAaWcB8SC4BwIt6qkZ/TwiVY8ZRI= diff --git a/pkg/sync/grpc/grpc_sync.go b/pkg/sync/grpc/grpc_sync.go index 1f6dcd3bf..3ed80ff0a 100644 --- a/pkg/sync/grpc/grpc_sync.go +++ b/pkg/sync/grpc/grpc_sync.go @@ -6,7 +6,8 @@ import ( "io" "strings" - "buf.build/gen/go/kavindudodan/flagd/grpc/go/sync/v1/servicev1grpc" + // todo - from schema push + "buf.build/gen/go/kavindudodan/flagd/grpc/go/sync/v1/syncv1grpc" v1 "buf.build/gen/go/kavindudodan/flagd/protocolbuffers/go/sync/v1" "github.com/open-feature/flagd/pkg/logger" @@ -33,7 +34,7 @@ func (g *Sync) Sync(ctx context.Context, dataSync chan<- sync.DataSync) error { return err } - client := servicev1grpc.NewFlagServiceClient(dial) + client := syncv1grpc.NewFlagServiceClient(dial) stream, err := client.SyncFlags(context.Background(), &v1.SyncFlagsRequest{Key: g.Key}) if err != nil { @@ -58,7 +59,7 @@ func (g *Sync) Sync(ctx context.Context, dataSync chan<- sync.DataSync) error { return err } -func (g *Sync) streamHandler(stream servicev1grpc.FlagService_SyncFlagsClient, dataSync chan<- sync.DataSync) error { +func (g *Sync) streamHandler(stream syncv1grpc.FlagService_SyncFlagsClient, dataSync chan<- sync.DataSync) error { for { data, err := stream.Recv() if err != nil { diff --git a/schema/buf.gen.yaml b/schema/buf.gen.yaml deleted file mode 100644 index 1c73de6af..000000000 --- a/schema/buf.gen.yaml +++ /dev/null @@ -1,8 +0,0 @@ -version: v1 -plugins: - - plugin: go - out: gen/proto/go - opt: paths=source_relative - - plugin: go-grpc - out: gen/proto/go - opt: paths=source_relative \ No newline at end of file diff --git a/schema/buf.yaml b/schema/buf.yaml deleted file mode 100644 index 7050cc463..000000000 --- a/schema/buf.yaml +++ /dev/null @@ -1,9 +0,0 @@ -version: v1 -# todo - packaging to flagd -name: buf.build/kavindudodan/flagd -breaking: - use: - - FILE -lint: - use: - - DEFAULT \ No newline at end of file diff --git a/schema/sync/v1/flags.proto b/schema/sync/v1/flags.proto deleted file mode 100644 index da64cc735..000000000 --- a/schema/sync/v1/flags.proto +++ /dev/null @@ -1,51 +0,0 @@ -syntax = "proto3"; - -package sync.service.v1; - -// todo - packaging to flagd -option go_package = "sync/service/v1"; - - -/* -SyncFlagsRequest convey a key that identifies the flagd instance, enabling Sync provider to filter -specific flags for a specific flagd deployment. -*/ -message SyncFlagsRequest { - string key = 1; -} - -//SyncState convey the state of the payload -enum SyncState{ - // Value is ignored by the listening flagd - SYNC_STATE_UNSPECIFIED = 0; - - // All the flags matching the request. This is the default response and other states can be ignored - // by the implementation. Flagd internally replace all existing flags for this response state. - SYNC_STATE_ALL = 1; - - // Convey an addition of a flag. Flagd internally handles this by combining new flags with existing ones - SYNC_STATE_ADD = 2; - - // Convey an update of a flag. Flagd internally try to update if the updated flag already exist OR if it is not, - // then it will get added - SYNC_STATE_UPDATE = 3; - - // Convey a deletion of a flag. Flagd internally removes the flag - SYNC_STATE_DELETE = 4; - - // Optional server ping to check client connectivity. Handling is ignored by flagd and is to merely support live check - SYNC_STATE_PING = 5; -} - -// SyncFlagsResponse is the response contains flags and state -message SyncFlagsResponse { - // flagd feature flag configuration - string flags = 1; - // State conveying the operation to be performed by flagd. See descriptions of state for an explanation of values - SyncState state = 2; -} - -// FlagService implements a server streaming to provide realtime flag configurations -service FlagService { - rpc SyncFlags(SyncFlagsRequest) returns (stream SyncFlagsResponse) {}; -} \ No newline at end of file