Skip to content

Commit

Permalink
refactor: drop x/net dependency (#104)
Browse files Browse the repository at this point in the history
replace x/net/context with stdlib context
fix compile errors after docker bump
  • Loading branch information
kruskall authored Aug 11, 2024
1 parent c3f4ac4 commit a0803d1
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 43 deletions.
74 changes: 37 additions & 37 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1499,43 +1499,6 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/go-licence-detector@
limitations under the License.


--------------------------------------------------------------------------------
Dependency : golang.org/x/net
Version: v0.26.0
Licence type (autodetected): BSD-3-Clause
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/golang.org/x/[email protected]/LICENSE:

Copyright (c) 2009 The Go Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


--------------------------------------------------------------------------------
Dependency : gopkg.in/yaml.v2
Version: v2.4.0
Expand Down Expand Up @@ -13563,6 +13526,43 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


--------------------------------------------------------------------------------
Dependency : golang.org/x/net
Version: v0.26.0
Licence type (autodetected): BSD-3-Clause
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/golang.org/x/[email protected]/LICENSE:

Copyright (c) 2009 The Go Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


--------------------------------------------------------------------------------
Dependency : golang.org/x/oauth2
Version: v0.10.0
Expand Down
8 changes: 4 additions & 4 deletions docker/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@
package docker

import (
"context"
"os"
"testing"

"github.com/docker/docker/api"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
"github.com/stretchr/testify/assert"
"golang.org/x/net/context"
)

func TestNewClient(t *testing.T) {
c, err := NewClient(client.DefaultDockerHost, nil, nil)
assert.NoError(t, err)
assert.NotNil(t, c)

_, err = c.ContainerList(context.Background(), types.ContainerListOptions{})
_, err = c.ContainerList(context.Background(), container.ListOptions{})
assert.NoError(t, err)

// This test only works on newer Docker versions (any supported one really)
Expand All @@ -58,6 +58,6 @@ func TestNewClient(t *testing.T) {
assert.NotNil(t, c)
assert.Equal(t, "1.22", c.ClientVersion())

_, err = c.ContainerList(context.Background(), types.ContainerListOptions{})
_, err = c.ContainerList(context.Background(), container.ListOptions{})
assert.NoError(t, err)
}
2 changes: 1 addition & 1 deletion docker/watcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
package docker

import (
"context"
"errors"
"sync"
"testing"
Expand All @@ -31,7 +32,6 @@ import (
"github.com/docker/docker/api/types/events"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"

"github.com/elastic/elastic-agent-libs/logp"
)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ require (
github.com/elastic/elastic-agent-libs v0.3.3
github.com/magefile/mage v1.13.0
github.com/stretchr/testify v1.9.0
golang.org/x/net v0.26.0
k8s.io/api v0.29.5
k8s.io/apimachinery v0.29.5
k8s.io/client-go v0.29.5
Expand Down Expand Up @@ -68,6 +67,7 @@ require (
go.uber.org/zap v1.21.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
Expand Down

0 comments on commit a0803d1

Please sign in to comment.