Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transition to use golang/protobuf to support automated code generation #226

Merged
merged 10 commits into from
Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

34 changes: 1 addition & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,26 @@ PKG := github.com/envoyproxy/go-control-plane

.PHONY: build
build:
@echo "--> building"
@go build ./pkg/... ./envoy/...

.PHONY: clean
clean:
@echo "--> cleaning compiled objects and binaries"
@go clean -tags netgo -i ./...
@rm -rf $(BINDIR)/*

.PHONY: test
test:
@echo "--> running unit tests"
@go test ./pkg/...

.PHONY: cover
cover:
@echo "--> running coverage tests"
@build/coverage.sh

.PHONY: format
format:
@echo "--> formatting code with 'goimports' tool"
@goimports -local $(PKG) -w -l pkg envoy
@goimports -local $(PKG) -w -l pkg

#-----------------
#-- integration
#-----------------
.PHONY: $(BINDIR)/test integration integration.ads integration.xds integration.rest integration.ads.tls

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

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

integration.ads.tls: $(BINDIR)/test
env XDS=ads build/integration.sh -tls

#-----------------
#-- code generaion
#-----------------

generate:
@echo "--> vendoring protobufs"
@go mod vendor
@echo "--> generating pb.go files"
$(SHELL) build/generate_protos.sh

$(BINDIR):
@mkdir -p $(BINDIR)

.PHONY: generate-patch
generate-patch:
@echo "--> patching generated code due to issue with protoc-gen-validate"
find envoy -type f -print0 |\
xargs -0 sed -i 's#"envoy/api/v2/core"#"github.com/envoyproxy/go-control-plane/envoy/api/v2/core"#g'
find envoy -type f -print0 |\
xargs -0 sed -i 's#"envoy/api/v2"#"github.com/envoyproxy/go-control-plane/envoy/api/v2"#g'
27 changes: 1 addition & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/envoyproxy/go-control-plane)](https://goreportcard.com/report/github.com/envoyproxy/go-control-plane)
[![GoDoc](https://godoc.org/github.com/envoyproxy/go-control-plane?status.svg)](https://godoc.org/github.com/envoyproxy/go-control-plane)


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


## Scope

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

1. Generate proto files (if you update the [data-plane-api](https://github.com/envoyproxy/data-plane-api)
dependency)

```sh
./build/run_docker.sh make generate
```

__NOTE__: you may need to apply a small patch to correct imports in the generate files:

```sh
./build/run_docker.sh make generate-patch
```

Format the code:

```sh
./build/run_docker.sh make format
```

Run build and unit tests again:

```sh
./build/run_docker.sh make build test
```

1. Run [integration test](pkg/test/main/README.md) against the latest Envoy binary:

```sh
Expand Down
77 changes: 0 additions & 77 deletions build/generate_protos.sh

This file was deleted.

1 change: 0 additions & 1 deletion data-plane-api
Submodule data-plane-api deleted from 507755
Loading