Skip to content

Commit

Permalink
Transition to use golang/protobuf to support automated code generation (
Browse files Browse the repository at this point in the history
  • Loading branch information
kyessenov authored Sep 10, 2019
1 parent ba541bc commit 52b167a
Show file tree
Hide file tree
Showing 489 changed files with 104,392 additions and 171,883 deletions.
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

0 comments on commit 52b167a

Please sign in to comment.