Skip to content

Commit afa492d

Browse files
authored
Merge pull request #16 from bigcommerce/INFRA-26220/upgrade-docker-api-version
INFRA-26220: Bump default Docker API version to 1.40
2 parents 92f3a1d + accc05a commit afa492d

11 files changed

Lines changed: 25 additions & 16 deletions

File tree

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ orbs:
1313
executors:
1414
go:
1515
docker:
16-
- image: cimg/go:1.23
16+
- image: cimg/go:1.26
1717
environment:
18-
DOCKER_API_VERSION: 1.39
18+
DOCKER_API_VERSION: '1.40'
1919

2020
#################################################################################
2121
# Jobs

.env-example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export DOCKER_API_VERSION=1.39
1+
export DOCKER_API_VERSION=1.40

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
tmp
22
bonvoy
3+
bin/
34
dist/
45
.idea/
56
*.iml

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@ GOCLEAN := $(GOCMD) clean
55
PATH := ${GOBIN}:${PATH}
66

77
export PATH
8-
OBJECT=bonvoy
8+
BINARY_NAME=./bin/bonvoy
99

1010
default: deps build
1111

1212
clean:
1313
$(GOCLEAN)
14-
rm -f $(OBJECT)
14+
rm -f $(BINARY_NAME)
15+
rm -f $(BINARY_NAME)-linux-amd64
1516

1617
build:
17-
$(GOBUILD) -v -o ${OBJECT}
18+
mkdir -p bin
19+
$(GOBUILD) -v -o $(BINARY_NAME) .
1820

1921
deps:
2022
$(GOCMD) mod tidy
@@ -34,4 +36,4 @@ test-unit:
3436
$(GOCMD) test -v -coverprofile=c.out $$(go list ./... | grep -v vendor/)
3537

3638
build-linux:
37-
GOOS=linux GOARCH=amd64 $(GOBUILD) -v -o ${OBJECT}-linux-amd64
39+
GOOS=linux GOARCH=amd64 $(GOBUILD) -v -o $(BINARY_NAME)-linux-amd64

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
A simple go CLI tool to perform various tasks against Envoy sidecars in a Consul
66
Connect and Nomad environment.
77

8-
Supports Consul 1.10+, Nomad 1.1.3+, and Envoy 1.18+. Requires DOCKER_API_VERSION 1.39.
8+
Supports Consul 1.10+, Nomad 1.1.3+, Envoy 1.18+, and Docker CE 29+. Defaults to `DOCKER_API_VERSION` 1.40 when unset.
99

1010
## Usage
1111

bonvoy.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import (
88
)
99

1010
func main() {
11-
_ = os.Setenv("DOCKER_API_VERSION", "1.39")
11+
if os.Getenv("DOCKER_API_VERSION") == "" {
12+
_ = os.Setenv("DOCKER_API_VERSION", "1.40")
13+
}
1214
config.Load()
1315
commands.NewRegistry().Init()
1416
}

docker/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (c *Client) GetSidecarContainer(serviceName string) (types.ContainerJSON, e
6262
} else if len(containerNames) == 1 {
6363
desiredName = containerNames[0]
6464
} else {
65-
return types.ContainerJSON{}, fmt.Errorf("No sidecar found for name: " + serviceName)
65+
return types.ContainerJSON{}, fmt.Errorf("No sidecar found for name: %s", serviceName)
6666
}
6767

6868
var desiredId = ""

docker/client_test.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
package docker
22

3-
import "testing"
3+
import (
4+
"os"
5+
"testing"
6+
)
47

58
func TestNewClient(t *testing.T) {
69
t.Run("returns a Client from env", func(t *testing.T) {
10+
_ = os.Setenv("DOCKER_API_VERSION", "1.40")
711
client := NewClient()
8-
if client.cli.ClientVersion() != "1.39" {
9-
t.Error("Invalid client version returned: " + client.cli.ClientVersion() + " != 1.39")
12+
if client.cli.ClientVersion() != "1.40" {
13+
t.Error("Invalid client version returned: " + client.cli.ClientVersion() + " != 1.40")
1014
}
1115
})
1216
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module bonvoy
22

3-
go 1.23
3+
go 1.26
44

55
require (
66
github.com/Devatoria/go-nsenter v0.0.0-20170612091819-0aa1e5f7748c

script/build-remote

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -xeou pipefail
44

55
cd /opt/bonvoy || exit 1
66

7-
export DOCKER_API_VERSION=1.39
7+
export DOCKER_API_VERSION=1.40
88

99
go mod tidy
1010
go build bonvoy

0 commit comments

Comments
 (0)