No ability to add docker.io credentials in custom_registries

Bug #1943877 reported by Bartosz Woronicz
This bug report is a duplicate of:  Bug #1943545: Cannot override docker.io. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Containerd Subordinate Charm
New
Undecided
Unassigned

Bug Description

The charm does no handle properly when we put docker.io in custom_registries,
for instance
juju config custom_registries='[{"host": "docker.io", "username": "testtux", "password": "somepassword"}]'

That will result in fault config.toml with doubled mirror entries for docker.io
```
$ journalctl -u containerd -f
...
Sep 16 10:41:56 hpc-k8s-vm-mcp-1 containerd[540735]: containerd: failed to load TOML: /etc/containerd/config.toml: (53, 6): duplicated tables
```

```
    [plugins.cri.registry]
      [plugins.cri.registry.mirrors]
        [plugins.cri.registry.mirrors."docker.io"]
          endpoint = ["https://registry-1.docker.io"]
    [plugins.cri.registry.mirrors."docker.io"]
```

The fix for that would be check the custom_registries list if it doesn't contain the docker.io already.

That consider charm versions up to these commits
```

commit 9f15599353613d2f3e8a0d120ba06c3dd0f5a281 (HEAD -> refs/heads/master, refs/remotes/origin/master, refs/remotes/origin/HEAD)
Author: afrikha <email address hidden>
Date: Tue Aug 24 14:14:35 2021 -0400

    Add support for containerd v2 config (#50)

    * add support for containerd config v2

    * remove note from README

    * Update README.md

    * explicitly state the value v2 to set it to the new format

    Co-authored-by: canonical-deployer <email address hidden>

commit 475f8e3c4f3f7f1893aecc443f420901cf195984 (refs/remotes/origin/stable)
Author: Cory Johns <email address hidden>
Date: Fri Jun 18 14:48:54 2021 -0400

    Fix unit tests to work with new unitdata support (#49)

    The charms.unit_test library was updated to include better support for
    unitdata, removing the need to treat unitdata as a mock.
```

Revision history for this message
Bartosz Woronicz (mastier1) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.