Skip to content

Commit 041306b

Browse files
Go install bug fix (#117)
* TLS for grpc service Signed-off-by: James-Milligan <[email protected]> * buf remote generation Signed-off-by: James-Milligan <[email protected]> * removed main schemas directory Signed-off-by: James-Milligan <[email protected]> * import flagd-definitions from temporary replace module Signed-off-by: James-Milligan <[email protected]> * temporary replaced submodule Signed-off-by: James-Milligan <[email protected]> * removed temporary files and replaced with new flagd-definitions import Signed-off-by: James-Milligan <[email protected]> * removed embed import, updated github actions Signed-off-by: James-Milligan <[email protected]>
1 parent 67b70e4 commit 041306b

File tree

12 files changed

+212
-63
lines changed

12 files changed

+212
-63
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ jobs:
2323
uses: actions/setup-go@v1
2424
with:
2525
go-version: '1.18.1'
26-
- uses: bufbuild/[email protected]
27-
with:
28-
version: '1.1.1'
29-
- run: make generate
3026
- run: make lint
3127

3228
test:
@@ -41,10 +37,6 @@ jobs:
4137
uses: actions/setup-go@v1
4238
with:
4339
go-version: '1.18.1'
44-
- uses: bufbuild/[email protected]
45-
with:
46-
version: '1.1.1'
47-
- run: make generate
4840
- run: make test
4941

5042
docker-local:

.github/workflows/release.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ jobs:
6363
uses: actions/setup-go@v3
6464
with:
6565
go-version: "1.18.1"
66-
67-
- uses: bufbuild/[email protected]
68-
with:
69-
version: "1.1.1"
70-
- run: make generate
7166
- name: Run GoReleaser
7267
uses: goreleaser/goreleaser-action@v3
7368
with:

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
[submodule "schemas"]
2-
path = schemas
3-
url = https://github.com/open-feature/schemas
4-
branch = main

Dockerfile

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,12 @@ COPY go.sum go.sum
1010
# cache deps before building and copying source so that we don't need to re-download as much
1111
# and so that source changes don't invalidate our downloaded layer
1212
RUN go mod download
13-
# install buf and protoc binaries
14-
RUN go install github.com/bufbuild/buf/cmd/buf@latest
15-
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
16-
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
17-
RUN go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest
18-
RUN go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest
1913

2014
# Copy the go source
2115
COPY main.go main.go
2216
COPY cmd/ cmd/
2317
COPY pkg/ pkg/
24-
COPY schemas/ schemas/
2518

26-
# Copy the code generation configs
27-
COPY schemas/protobuf schemas/protobuf
28-
COPY schemas/json/flagd-definitions.json pkg/eval/flagd-definitions.json
29-
# Generate http/grpc stubs
30-
RUN cd schemas/protobuf && ${GOPATH}/bin/buf generate --template buf.gen.go-server.yaml && cd ../..
3119
# Build
3220
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o flagd main.go
3321

Makefile

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,15 @@ guard-%:
66
echo "Environment variable $* not set"; \
77
exit 1; \
88
fi
9-
generate:
10-
git submodule update --init --recursive
11-
cp schemas/json/flagd-definitions.json pkg/eval/flagd-definitions.json
12-
go install github.com/bufbuild/buf/cmd/buf@latest
13-
cd schemas/protobuf && buf generate --template buf.gen.go-server.yaml
14-
docker-build: generate
9+
docker-build:
1510
docker buildx build --platform="linux/ppc64le,linux/s390x,linux/amd64,linux/arm64" -t ${IMG} .
16-
docker-push: generate
11+
docker-push:
1712
docker buildx build --push --platform="linux/ppc64le,linux/s390x,linux/amd64,linux/arm64" -t ${IMG} .
18-
build: generate
13+
build:
1914
go build -o flagd
20-
test: generate
15+
test:
2116
go test -cover ./...
22-
run: generate
17+
run:
2318
go run main.go start -f config/samples/example_flags.json
2419
install:
2520
cp systemd/flagd.service /etc/systemd/system/flagd.service

go.mod

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@ require (
77
github.com/diegoholiveira/jsonlogic/v3 v3.2.3
88
github.com/fsnotify/fsnotify v1.5.4
99
github.com/go-chi/chi/v5 v5.0.7
10-
github.com/golang/mock v1.4.4
11-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.3
10+
github.com/golang/mock v1.6.0
11+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.1
12+
github.com/open-feature/schemas v0.0.0-20220809125026-ba7ea0aa4841
1213
github.com/robfig/cron v1.2.0
1314
github.com/sirupsen/logrus v1.8.1
1415
github.com/soheilhy/cmux v0.1.5
1516
github.com/spf13/cobra v1.4.0
1617
github.com/spf13/viper v1.11.0
1718
github.com/stretchr/testify v1.7.4
1819
github.com/xeipuuv/gojsonschema v1.2.0
19-
google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad
20-
google.golang.org/grpc v1.47.0
21-
google.golang.org/protobuf v1.28.0
20+
go.buf.build/open-feature/flagd-server/open-feature/flagd v1.1.2
21+
google.golang.org/grpc v1.48.0
22+
google.golang.org/protobuf v1.28.1
2223
)
2324

2425
require gopkg.in/yaml.v2 v2.4.0 // indirect
@@ -43,9 +44,10 @@ require (
4344
github.com/subosito/gotenv v1.2.0 // indirect
4445
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
4546
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
46-
golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 // indirect
47+
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect
4748
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect
4849
golang.org/x/text v0.3.7 // indirect
50+
google.golang.org/genproto v0.0.0-20220728213248-dd149ef739b9 // indirect
4951
gopkg.in/ini.v1 v1.66.4 // indirect
5052
gopkg.in/yaml.v3 v3.0.1 // indirect
5153
)

0 commit comments

Comments
 (0)