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

gRPC update #3043

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ jobs:
# Needed to install go
OS: linux
ARCH: amd64
GOVERSION: 1.13
GOVERSION: 1.17
GO111MODULE: "off"
# Needed to install protoc
PROTOC_VERSION: 3.6.1

Expand All @@ -29,7 +30,7 @@ jobs:

# /dev/shm in the container is tmpfs although files in /dev/shm are not executable.
# If we specify TMPDIR=/dev/shm, /dev/shm will be used by our tests, which call
# ioutil.TempDir/ioutil.TempFile, to write temporary files.
# os.MkdirTemp/os.CreateTemp, to write temporary files.
# We can also specify GOTMPDIR=/tmp or some other non-tmpfs directory
# (see https://golang.org/doc/go1.10#goroot) - this is the directory in which the
# go tool itself will put temporarily compiled test executables, etc.
Expand Down
4 changes: 2 additions & 2 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ vndr

It's possible to update only one dependency:
```
vndr github.com/coreos/etcd v3.0.9
vndr go.etcd.io/etcd v3.0.9
```

but it should be in sync with `vendor.conf`.

Also, you can update dependency from fork for testing:
```
vndr github.com/coreos/etcd <revision> https://github.com/LK4D4/etcd.git
vndr go.etcd.io/etcd <revision> https://github.com/LK4D4/etcd.git
```

### Regenerating protobuf bindings
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NOTE(dperny): for some reason, alpine was giving me trouble
ARG GO_VERSION=1.13.15
ARG GO_VERSION=1.17.4
ARG DEBIAN_FRONTEND=noninteractive
ARG BASE_DEBIAN_DISTRO="buster"
ARG GOLANG_IMAGE="golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO}"
Expand All @@ -16,6 +16,7 @@ RUN curl --silent --show-error --location --output protoc.zip \
&& unzip -d /usr/local protoc.zip include/\* bin/\* \
&& rm -f protoc.zip

ENV GO111MODULE=off
WORKDIR /go/src/github.com/docker/swarmkit/

# install the dependencies from `make setup`
Expand Down
5 changes: 2 additions & 3 deletions agent/exec/dockerapi/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"reflect"
"runtime"
"testing"
Expand Down Expand Up @@ -38,7 +37,7 @@ func TestControllerPrepare(t *testing.T) {

client.ImagePullFn = func(_ context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error) {
if refStr == config.image() {
return ioutil.NopCloser(bytes.NewBuffer([]byte{})), nil
return io.NopCloser(bytes.NewBuffer([]byte{})), nil
}
panic("unexpected call of ImagePull")
}
Expand Down Expand Up @@ -68,7 +67,7 @@ func TestControllerPrepareAlreadyPrepared(t *testing.T) {

client.ImagePullFn = func(_ context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error) {
if refStr == config.image() {
return ioutil.NopCloser(bytes.NewBuffer([]byte{})), nil
return io.NopCloser(bytes.NewBuffer([]byte{})), nil
}
panic("unexpected call of ImagePull")
}
Expand Down
5 changes: 2 additions & 3 deletions agent/storage_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package agent

import (
"io/ioutil"
"math/rand"
"os"
"path/filepath"
Expand Down Expand Up @@ -176,11 +175,11 @@ func genTaskStatus() *api.TaskStatus {
// tests.
func storageTestEnv(t *testing.T) (*bolt.DB, func()) {
var cleanup []func()
dir, err := ioutil.TempDir("", "agent-TestStorage-")
dir, err := os.MkdirTemp("", "agent-TestStorage-")
assert.NoError(t, err)

dbpath := filepath.Join(dir, "tasks.db")
assert.NoError(t, os.MkdirAll(dir, 0777))
assert.NoError(t, os.MkdirAll(dir, 0o777))
cleanup = append(cleanup, func() { os.RemoveAll(dir) })

db, err := bolt.Open(dbpath, 0666, nil)
Expand Down
3 changes: 1 addition & 2 deletions agent/testutils/fakes.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package testutils

import (
"context"
"io/ioutil"
"net"
"os"
"path/filepath"
Expand Down Expand Up @@ -235,7 +234,7 @@ func NewMockDispatcher(t *testing.T, secConfig *ca.SecurityConfig, local bool) (
cleanup func()
)
if local {
tempDir, err := ioutil.TempDir("", "local-dispatcher-socket")
tempDir, err := os.MkdirTemp("", "local-dispatcher-socket")
require.NoError(t, err)
addr = filepath.Join(tempDir, "socket")
l, err = net.Listen("unix", addr)
Expand Down
132 changes: 117 additions & 15 deletions api/api.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10433,7 +10433,7 @@ file {
syntax: "proto3"
}
file {
name: "github.com/coreos/etcd/raft/raftpb/raft.proto"
name: "go.etcd.io/etcd/raft/raftpb/raft.proto"
package: "raftpb"
dependency: "gogoproto/gogo.proto"
message_type {
Expand Down Expand Up @@ -10691,11 +10691,11 @@ file {
message_type {
name: "ConfState"
field {
name: "nodes"
name: "voters"
number: 1
label: LABEL_REPEATED
type: TYPE_UINT64
json_name: "nodes"
json_name: "voters"
}
field {
name: "learners"
Expand All @@ -10704,46 +10704,129 @@ file {
type: TYPE_UINT64
json_name: "learners"
}
field {
name: "voters_outgoing"
number: 3
label: LABEL_REPEATED
type: TYPE_UINT64
json_name: "votersOutgoing"
}
field {
name: "learners_next"
number: 4
label: LABEL_REPEATED
type: TYPE_UINT64
json_name: "learnersNext"
}
field {
name: "auto_leave"
number: 5
label: LABEL_OPTIONAL
type: TYPE_BOOL
options {
65001: 0
}
json_name: "autoLeave"
}
}
message_type {
name: "ConfChange"
field {
name: "ID"
name: "type"
number: 2
label: LABEL_OPTIONAL
type: TYPE_ENUM
type_name: ".raftpb.ConfChangeType"
options {
65001: 0
}
json_name: "type"
}
field {
name: "node_id"
number: 3
label: LABEL_OPTIONAL
type: TYPE_UINT64
options {
65001: 0
65004: "NodeID"
}
json_name: "nodeId"
}
field {
name: "context"
number: 4
label: LABEL_OPTIONAL
type: TYPE_BYTES
json_name: "context"
}
field {
name: "id"
number: 1
label: LABEL_OPTIONAL
type: TYPE_UINT64
options {
65001: 0
65004: "ID"
}
json_name: "ID"
json_name: "id"
}
}
message_type {
name: "ConfChangeSingle"
field {
name: "Type"
number: 2
name: "type"
number: 1
label: LABEL_OPTIONAL
type: TYPE_ENUM
type_name: ".raftpb.ConfChangeType"
options {
65001: 0
}
json_name: "Type"
json_name: "type"
}
field {
name: "NodeID"
number: 3
name: "node_id"
number: 2
label: LABEL_OPTIONAL
type: TYPE_UINT64
options {
65001: 0
65004: "NodeID"
}
json_name: "NodeID"
json_name: "nodeId"
}
}
message_type {
name: "ConfChangeV2"
field {
name: "Context"
number: 4
name: "transition"
number: 1
label: LABEL_OPTIONAL
type: TYPE_ENUM
type_name: ".raftpb.ConfChangeTransition"
options {
65001: 0
}
json_name: "transition"
}
field {
name: "changes"
number: 2
label: LABEL_REPEATED
type: TYPE_MESSAGE
type_name: ".raftpb.ConfChangeSingle"
options {
65001: 0
}
json_name: "changes"
}
field {
name: "context"
number: 3
label: LABEL_OPTIONAL
type: TYPE_BYTES
json_name: "Context"
json_name: "context"
}
}
enum_type {
Expand All @@ -10756,6 +10839,10 @@ file {
name: "EntryConfChange"
number: 1
}
value {
name: "EntryConfChangeV2"
number: 2
}
}
enum_type {
name: "MessageType"
Expand Down Expand Up @@ -10836,6 +10923,21 @@ file {
number: 18
}
}
enum_type {
name: "ConfChangeTransition"
value {
name: "ConfChangeTransitionAuto"
number: 0
}
value {
name: "ConfChangeTransitionJointImplicit"
number: 1
}
value {
name: "ConfChangeTransitionJointExplicit"
number: 2
}
}
enum_type {
name: "ConfChangeType"
value {
Expand Down Expand Up @@ -10868,7 +10970,7 @@ file {
package: "docker.swarmkit.v1"
dependency: "github.com/docker/swarmkit/api/objects.proto"
dependency: "github.com/docker/swarmkit/api/types.proto"
dependency: "github.com/coreos/etcd/raft/raftpb/raft.proto"
dependency: "go.etcd.io/etcd/raft/raftpb/raft.proto"
dependency: "gogoproto/gogo.proto"
dependency: "github.com/docker/swarmkit/protobuf/plugin/plugin.proto"
message_type {
Expand Down
Loading