Skip to content

Commit 52b167a

Browse files
authored
Transition to use golang/protobuf to support automated code generation (#226)
1 parent ba541bc commit 52b167a

File tree

489 files changed

+104392
-171883
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

489 files changed

+104392
-171883
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,26 @@ PKG := github.com/envoyproxy/go-control-plane
1010

1111
.PHONY: build
1212
build:
13-
@echo "--> building"
1413
@go build ./pkg/... ./envoy/...
1514

16-
.PHONY: clean
17-
clean:
18-
@echo "--> cleaning compiled objects and binaries"
19-
@go clean -tags netgo -i ./...
20-
@rm -rf $(BINDIR)/*
21-
2215
.PHONY: test
2316
test:
24-
@echo "--> running unit tests"
2517
@go test ./pkg/...
2618

2719
.PHONY: cover
2820
cover:
29-
@echo "--> running coverage tests"
3021
@build/coverage.sh
3122

3223
.PHONY: format
3324
format:
34-
@echo "--> formatting code with 'goimports' tool"
35-
@goimports -local $(PKG) -w -l pkg envoy
25+
@goimports -local $(PKG) -w -l pkg
3626

3727
#-----------------
3828
#-- integration
3929
#-----------------
4030
.PHONY: $(BINDIR)/test integration integration.ads integration.xds integration.rest integration.ads.tls
4131

4232
$(BINDIR)/test:
43-
@echo "--> building test binary"
4433
@go build -race -o $@ pkg/test/main/main.go
4534

4635
integration: integration.xds integration.ads integration.rest integration.ads.tls
@@ -56,24 +45,3 @@ integration.rest: $(BINDIR)/test
5645

5746
integration.ads.tls: $(BINDIR)/test
5847
env XDS=ads build/integration.sh -tls
59-
60-
#-----------------
61-
#-- code generaion
62-
#-----------------
63-
64-
generate:
65-
@echo "--> vendoring protobufs"
66-
@go mod vendor
67-
@echo "--> generating pb.go files"
68-
$(SHELL) build/generate_protos.sh
69-
70-
$(BINDIR):
71-
@mkdir -p $(BINDIR)
72-
73-
.PHONY: generate-patch
74-
generate-patch:
75-
@echo "--> patching generated code due to issue with protoc-gen-validate"
76-
find envoy -type f -print0 |\
77-
xargs -0 sed -i 's#"envoy/api/v2/core"#"github.com/envoyproxy/go-control-plane/envoy/api/v2/core"#g'
78-
find envoy -type f -print0 |\
79-
xargs -0 sed -i 's#"envoy/api/v2"#"github.com/envoyproxy/go-control-plane/envoy/api/v2"#g'

README.md

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
[![Go Report Card](https://goreportcard.com/badge/github.com/envoyproxy/go-control-plane)](https://goreportcard.com/report/github.com/envoyproxy/go-control-plane)
55
[![GoDoc](https://godoc.org/github.com/envoyproxy/go-control-plane?status.svg)](https://godoc.org/github.com/envoyproxy/go-control-plane)
66

7-
87
This repository contains a Go-based implementation of an API server that
98
implements the discovery service APIs defined in
109
[data-plane-api](https://github.com/envoyproxy/data-plane-api).
1110

11+
1212
## Scope
1313

1414
Due to the variety of platforms out there, there is no single
@@ -52,31 +52,6 @@ in the same environment as the circle ci. This makes sure to produce a consisten
5252
./build/run_docker.sh make build test
5353
```
5454

55-
1. Generate proto files (if you update the [data-plane-api](https://github.com/envoyproxy/data-plane-api)
56-
dependency)
57-
58-
```sh
59-
./build/run_docker.sh make generate
60-
```
61-
62-
__NOTE__: you may need to apply a small patch to correct imports in the generate files:
63-
64-
```sh
65-
./build/run_docker.sh make generate-patch
66-
```
67-
68-
Format the code:
69-
70-
```sh
71-
./build/run_docker.sh make format
72-
```
73-
74-
Run build and unit tests again:
75-
76-
```sh
77-
./build/run_docker.sh make build test
78-
```
79-
8055
1. Run [integration test](pkg/test/main/README.md) against the latest Envoy binary:
8156

8257
```sh

build/generate_protos.sh

Lines changed: 0 additions & 77 deletions
This file was deleted.

data-plane-api

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)