Skip to content

Commit a0cc8da

Browse files
committed
container/(docker|podman): rename var that shadowed import
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent f36f455 commit a0cc8da

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

container/docker/handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,11 @@ func (h *containerHandler) GetCgroupPath(resource string) (string, error) {
364364
if !cgroups.IsCgroup2UnifiedMode() {
365365
res = resource
366366
}
367-
path, ok := h.cgroupPaths[res]
367+
cgroupPath, ok := h.cgroupPaths[res]
368368
if !ok {
369369
return "", fmt.Errorf("could not find path for resource %q for container %q", resource, h.reference.Name)
370370
}
371-
return path, nil
371+
return cgroupPath, nil
372372
}
373373

374374
func (h *containerHandler) GetContainerLabels() map[string]string {

container/podman/handler.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ func newContainerHandler(
113113
return nil, err
114114
}
115115

116-
rwLayerID, err := rwLayerID(storageDriver, storageDir, id)
116+
layerID, err := rwLayerID(storageDriver, storageDir, id)
117117
if err != nil {
118118
return nil, err
119119
}
120120

121-
rootfsStorageDir, zfsFilesystem, zfsParent, err := determineDeviceStorage(storageDriver, storageDir, rwLayerID)
121+
rootfsStorageDir, zfsFilesystem, zfsParent, err := determineDeviceStorage(storageDriver, storageDir, layerID)
122122
if err != nil {
123123
return nil, err
124124
}
@@ -163,12 +163,12 @@ func newContainerHandler(
163163
// This happens in cases such as kubernetes where the containers doesn't have an IP address itself and we need to use the pod's address
164164
networkMode := string(handler.networkMode)
165165
if handler.ipAddress == "" && strings.HasPrefix(networkMode, "container:") {
166-
id := strings.TrimPrefix(networkMode, "container:")
167-
ctnr, err := InspectContainer(id)
166+
containerID := strings.TrimPrefix(networkMode, "container:")
167+
c, err := InspectContainer(containerID)
168168
if err != nil {
169169
return nil, err
170170
}
171-
handler.ipAddress = ctnr.NetworkSettings.IPAddress
171+
handler.ipAddress = c.NetworkSettings.IPAddress
172172
}
173173

174174
if metrics.Has(container.DiskUsageMetrics) {
@@ -272,12 +272,12 @@ func (h *containerHandler) GetCgroupPath(resource string) (string, error) {
272272
if !cgroups.IsCgroup2UnifiedMode() {
273273
res = resource
274274
}
275-
path, ok := h.cgroupPaths[res]
275+
cgroupPath, ok := h.cgroupPaths[res]
276276
if !ok {
277277
return "", fmt.Errorf("couldn't find path for resource %q for container %q", resource, h.reference.Name)
278278
}
279279

280-
return path, nil
280+
return cgroupPath, nil
281281
}
282282

283283
func (h *containerHandler) GetContainerLabels() map[string]string {

0 commit comments

Comments
 (0)