Skip to content

Commit 87005b1

Browse files
authored
Merge pull request #138 from thaJeztah/update_gha
Remove deprecated graphdriver-plugins, assorted cleanups, and update to go1.21
2 parents 6eecb7b + 9e18292 commit 87005b1

20 files changed

+38
-1100
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ jobs:
1616
runs-on: ${{ matrix.platform }}
1717
steps:
1818
- name: Checkout code
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2020
- name: test
2121
run: make test

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
REPO_NAME = go-plugins-helpers
44
REPO_OWNER = docker
55
PKG_NAME = github.com/${REPO_OWNER}/${REPO_NAME}
6-
IMAGE = golang:1.16
6+
IMAGE = golang:1.21
77

88
all: test
99

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
A collection of helper packages to extend Docker Engine in Go
44

5-
Plugin type | Documentation | Description
6-
--------------|---------------|--------------------------------------------------
7-
Authorization | [Link](https://docs.docker.com/engine/extend/authorization/) | Extend API authorization mechanism
8-
Network | [Link](https://docs.docker.com/engine/extend/plugins_network/) | Extend network management
9-
Volume | [Link](https://docs.docker.com/engine/extend/plugins_volume/) | Extend persistent storage
10-
IPAM | [Link](https://github.com/docker/libnetwork/blob/master/docs/ipam.md) | Extend IP address management
11-
Graph (experimental) | [Link](https://github.com/docker/cli/blob/master/docs/extend/plugins_graphdriver.md)| Extend image and container fs storage
5+
| Plugin type | Documentation | Description |
6+
|---------------|-----------------------------------------------------------------------|------------------------------------|
7+
| Authorization | [Link](https://docs.docker.com/engine/extend/authorization/) | Extend API authorization mechanism |
8+
| Network | [Link](https://docs.docker.com/engine/extend/plugins_network/) | Extend network management |
9+
| Volume | [Link](https://docs.docker.com/engine/extend/plugins_volume/) | Extend persistent storage |
10+
| IPAM | [Link](https://github.com/docker/libnetwork/blob/master/docs/ipam.md) | Extend IP address management |
1211

13-
See the [understand Docker plugins documentation section](https://docs.docker.com/engine/extend/plugins/).
12+
See the [understand Docker plugins documentation section](https://docs.docker.com/engine/extend/).

authorization/api_test.go

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"crypto/x509/pkix"
99
"encoding/json"
1010
"fmt"
11-
"io/ioutil"
11+
"io"
1212
"math/big"
1313
"net/http"
1414
"os"
@@ -42,15 +42,13 @@ func (p *TestPlugin) AuthZRes(r Request) Response {
4242

4343
func TestActivate(t *testing.T) {
4444
response, err := http.Get("http://localhost:32456/Plugin.Activate")
45-
4645
if err != nil {
4746
t.Fatal(err)
4847
}
4948

5049
defer response.Body.Close()
5150

52-
body, err := ioutil.ReadAll(response.Body)
53-
51+
body, err := io.ReadAll(response.Body)
5452
if err != nil {
5553
t.Fatal(err)
5654
}
@@ -68,15 +66,13 @@ func TestAuthZReq(t *testing.T) {
6866
sdk.DefaultContentTypeV1_1,
6967
strings.NewReader(request),
7068
)
71-
7269
if err != nil {
7370
t.Fatal(err)
7471
}
7572

7673
defer response.Body.Close()
7774

78-
body, err := ioutil.ReadAll(response.Body)
79-
75+
body, err := io.ReadAll(response.Body)
8076
if err != nil {
8177
t.Fatal(err)
8278
}
@@ -107,15 +103,13 @@ func TestAuthZRes(t *testing.T) {
107103
sdk.DefaultContentTypeV1_1,
108104
strings.NewReader(request),
109105
)
110-
111106
if err != nil {
112107
t.Fatal(err)
113108
}
114109

115110
defer response.Body.Close()
116111

117-
body, err := ioutil.ReadAll(response.Body)
118-
112+
body, err := io.ReadAll(response.Body)
119113
if err != nil {
120114
t.Fatal(err)
121115
}
@@ -160,14 +154,14 @@ func TestPeerCertificateMarshalJSON(t *testing.T) {
160154
publickey := &privatekey.PublicKey
161155

162156
// create a self-signed certificate. template = parent
163-
var parent = template
157+
parent := template
164158
raw, err := x509.CreateCertificate(rand.Reader, template, parent, publickey, privatekey)
165159
require.NoError(t, err)
166160

167161
cert, err := x509.ParseCertificate(raw)
168162
require.NoError(t, err)
169163

170-
var certs = []*x509.Certificate{cert}
164+
certs := []*x509.Certificate{cert}
171165
addr := "www.authz.com/auth"
172166
req, err := http.NewRequest("GET", addr, nil)
173167
require.NoError(t, err)
@@ -191,11 +185,9 @@ func TestPeerCertificateMarshalJSON(t *testing.T) {
191185
require.Nil(t, err)
192186
require.Equal(t, "Earth", pcObj.Subject.Country[0])
193187
require.Equal(t, true, pcObj.IsCA)
194-
195188
})
196189

197190
}
198-
199191
}
200192

201193
func callURL(url string) {

graphdriver/README.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)