Skip to content

Commit

Permalink
ignore InspectContainer() deprecation warnings from staticcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
fho committed Oct 22, 2024
1 parent b0a7b05 commit 2d6a7fa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (b *Bridge) add(containerId string, quiet bool) {
return
}

container, err := b.docker.InspectContainer(containerId)
container, err := b.docker.InspectContainer(containerId) //nolint:staticcheck // deprecated
if err != nil {
log.Println("unable to inspect container:", containerId[:12], err)
return
Expand Down Expand Up @@ -330,7 +330,8 @@ func (b *Bridge) newService(port ServicePort, isgroup bool) *Service {
if strings.HasPrefix(networkMode, "container:") {
networkContainerId := strings.Split(networkMode, ":")[1]
log.Println(service.Name + ": detected container NetworkMode, linked to: " + networkContainerId[:12])
networkContainer, err := b.docker.InspectContainer(networkContainerId)
networkContainer, err := b.docker.InspectContainer(networkContainerId) //nolint:staticcheck // deprecated

if err != nil {
log.Println("unable to inspect network container:", networkContainerId[:12], err)
} else {
Expand Down Expand Up @@ -398,7 +399,7 @@ func (b *Bridge) shouldRemove(containerId string) bool {
if b.config.DeregisterCheck == "always" {
return true
}
container, err := b.docker.InspectContainer(containerId)
container, err := b.docker.InspectContainer(containerId) //nolint:staticcheck // deprecated
if _, ok := err.(*dockerapi.NoSuchContainer); ok {
// the container has already been removed from Docker
// e.g. probabably run with "--rm" to remove immediately
Expand Down

0 comments on commit 2d6a7fa

Please sign in to comment.