Mirantis / Mirantis/cri-dockerd

Fallback code for retrieving sandbox IP uses "docker inspect" fields that no longer exist

Open
#534 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.4k
Forks
356
Avg merge
4d 4h
Merged PRs (30d)
3

Description

The function dockerService.getIPs() first tries to get the sandbox IP through the network plugin, and if that fails, runs a "docker inspect" and checks the resulting JSON for the fields NetworkSettings.IPAddress and NetworkSettings.GlobalIPv6Address. However, these fields don't exist - apparently they were removed back in Docker 1.11. The code should instead retrieve NetworkSettings.Networks[networkName].IPAddress - of course taking into account that on Windows, Docker turns the network name default into nat.

In addition, going by the code, it seems getIPs() would log the message "Failed to read pod IP" even if it did manage to retrieve the IP this way.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at dockerService.getIPs and trace the fallback path that runs docker inspect. Check how NetworkSettings.Networks[networkName] is selected, including default versus nat on Windows, and verify that the failure message is not logged after a successful fallback. Confirm the getIPs behavior with the relevant existing tests or validation for this entry point.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
backend, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.