Skip to content

Commit

Permalink
RELEASE: 2.0 release
Browse files Browse the repository at this point in the history
- update dependencies
- upgrade go to 1.14
- upgrade go-swagger to 0.23.0
- add goreleaser for releases
- add documentation
  • Loading branch information
mjuraga committed Apr 27, 2020
1 parent e6538b6 commit 448d36e
Show file tree
Hide file tree
Showing 556 changed files with 2,856 additions and 3,070 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.13
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.13
go-version: 1.14
id: go

- name: Check out code into the Go module directory
Expand Down
48 changes: 48 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
before:
hooks:
- go mod download
- make clean
- mkdir build/
builds:
-
id: my-build
main: ./cmd/dataplaneapi/main.go
binary: ./build/dataplaneapi
gcflags:
- -l
- -N
ldflags:
- -s -w -X main.GitRepo={{.GitURL}} -X main.GitTag={{.Tag}} -X main.GitCommit={{.ShortCommit}} -X main.GitDirty= -X main.BuildTime={{.Date}}
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- freebsd
goarch:
- 386
- amd64
- arm
- arm64
archives:
-
id: my-archive
builds:
- my-build
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
replacements:
linux: Linux
darwin: Darwin
freebsd: FreeBSD
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
release:
draft: true
name_template: "HAProxy {{toupper .ProjectName}} v{{.Version}}"
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Data Plane API is generated using [go-swagger](https://github.com/go-swagger/go-
./swagger generate server -f haproxy_spec.yaml \
-A "Data Plane" \
-t $GOPATH/src/github.com/haproxytech/ \
--existing-models github.com/haproxytech/models \
--existing-models github.com/haproxytech/models/v2 \
--exclude-main \
--skip-models \
-s dataplaneapi \
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Building the Data Plane API

In order to build the Data Plane API you need go 1.12 installed on your system with go modules support enabled, and execute the following steps:
In order to build the Data Plane API you need go 1.14 installed on your system with go modules support enabled, and execute the following steps:

1\. Clone dataplaneapi repository

Expand Down Expand Up @@ -71,6 +71,10 @@ HAProxy options:
-i, --show-system-info Show system info on info endpoint
-f= Path to the dataplane configuration file
--userlist-file= Path to the dataplaneapi userlist file. By default userlist is read from HAProxy conf. When specified userlist would be read from this file
--fid= Path to file that will dataplaneapi use to write its id (not a pid) that was given to him after joining a cluster
-p, --maps-dir= Path to maps directory (default: /etc/haproxy/maps)
--update-map-files Flag used for syncing map files with runtime maps values
--update-map-files-period= Elapsed time in seconds between two maps syncing operations (default: 10)
Logging options:
--log-to=[stdout|file] Log target, can be stdout or file (default: stdout)
Expand All @@ -96,7 +100,7 @@ You can test it by simply running:
Test it out with curl, note that you need user/pass combination setup in HAProxy userlist in haproxy configuration (in above example: /etc/haproxy/haproxy.cfg, userlist controller):

```
curl -u <user>:<pass> -H "Content-Type: application/json" "http://127.0.0.1:5555/v1/"
curl -u <user>:<pass> -H "Content-Type: application/json" "http://127.0.0.1:5555/v2/"
```

If you are using secure passwords, supported algorithms are: md5, sha-256 and sha-512.
Expand All @@ -105,7 +109,7 @@ If you are using secure passwords, supported algorithms are: md5, sha-256 and sh

For more docs how to use the Data Plane API check our [documentation](https://www.haproxy.com/documentation/hapee/1-9r1/configuration/dataplaneapi/)

Alternatively, dataplaneapi serves it's own interactive documentation relevant for the current build on the `/v1/docs` uri. Just point your browser to the host/port dataplane was started with (i.e. `http://localhost:5555/v1/docs`)
Alternatively, dataplaneapi serves it's own interactive documentation relevant for the current build on the `/v2/docs` uri. Just point your browser to the host/port dataplane was started with (i.e. `http://localhost:5555/v2/docs`)

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion adapters/adapters.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/docker/go-units"

"github.com/haproxytech/models"
"github.com/haproxytech/models/v2"

"github.com/sirupsen/logrus"
)
Expand Down
15 changes: 15 additions & 0 deletions cmd/dataplaneapi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ import (
"github.com/haproxytech/dataplaneapi/operations"
)

//GitRepo ...
var GitRepo = ""

//GitTag ...
var GitTag = ""

//GitCommit ...
var GitCommit = "dev"

//GitDirty ...
var GitDirty = ".dirty"

//BuildTime ...
var BuildTime = ""

func init() {
log.SetFormatter(&log.TextFormatter{
FullTimestamp: true,
Expand Down
16 changes: 0 additions & 16 deletions cmd/dataplaneapi/version.go

This file was deleted.

2 changes: 1 addition & 1 deletion configuration/cluster_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"net/http"
"time"

client_native "github.com/haproxytech/client-native"
client_native "github.com/haproxytech/client-native/v2"
"github.com/haproxytech/config-parser/v2/types"
"github.com/haproxytech/dataplaneapi/haproxy"
log "github.com/sirupsen/logrus"
Expand Down
10 changes: 5 additions & 5 deletions configure_data_plane.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (

"github.com/haproxytech/dataplaneapi/adapters"
"github.com/haproxytech/dataplaneapi/operations/specification"
"github.com/haproxytech/models"
"github.com/haproxytech/models/v2"

log "github.com/sirupsen/logrus"

Expand All @@ -45,10 +45,10 @@ import (
"github.com/go-openapi/runtime/middleware"
"github.com/haproxytech/dataplaneapi/operations/discovery"

client_native "github.com/haproxytech/client-native"
client_native "github.com/haproxytech/client-native/v2"

"github.com/haproxytech/client-native/configuration"
runtime_api "github.com/haproxytech/client-native/runtime"
"github.com/haproxytech/client-native/v2/configuration"
runtime_api "github.com/haproxytech/client-native/v2/runtime"
dataplaneapi_config "github.com/haproxytech/dataplaneapi/configuration"
"github.com/haproxytech/dataplaneapi/handlers"
"github.com/haproxytech/dataplaneapi/haproxy"
Expand Down Expand Up @@ -626,7 +626,7 @@ func configureRuntimeClient(confClient *configuration.Client, haproxyOptions dat
log.Warningf("Error setting up runtime client with master socket: %s : %s", masterSocket, err.Error())
}
}
runtimeAPIs := globalConf.RuntimeApis
runtimeAPIs := globalConf.RuntimeAPIs
// if no master socket set, read from first valid socket if nbproc <= 1
if globalConf.Nbproc <= 1 {
socketList := make(map[int]string)
Expand Down
46 changes: 21 additions & 25 deletions doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 448d36e

Please sign in to comment.