Skip to content

Commit b3d7017

Browse files
authored
Close the socket listener explicitly (#663)
1 parent 9bbb31a commit b3d7017

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ ADDLICENSE ?= $(LOCALBIN)/addlicense-$(ADDLICENSE_VERSION)
161161

162162
## Tool Versions
163163
KUSTOMIZE_VERSION ?= v5.3.0
164-
CONTROLLER_TOOLS_VERSION ?= v0.16.0
165-
ENVTEST_VERSION ?= release-0.19
166-
GOLANGCI_LINT_VERSION ?= v2.1
164+
CONTROLLER_TOOLS_VERSION ?= v0.19.0
165+
ENVTEST_VERSION ?= release-0.22
166+
GOLANGCI_LINT_VERSION ?= v2.6
167167
ADDLICENSE_VERSION ?= v1.1.1
168168

169169
.PHONY: kustomize

cmd/libvirt-provider/app/app.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,11 @@ func runGRPCServer(ctx context.Context, setupLog logr.Logger, log logr.Logger, s
457457
if err != nil {
458458
return fmt.Errorf("failed to listen: %w", err)
459459
}
460+
defer func() {
461+
if err := l.Close(); err != nil {
462+
setupLog.Error(err, "failed to close listener")
463+
}
464+
}()
460465

461466
setupLog.Info("Starting grpc server", "Address", l.Addr().String())
462467
go func() {

0 commit comments

Comments
 (0)