Skip to content

Commit

Permalink
Fix double application
Browse files Browse the repository at this point in the history
Fixes: #3
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
  • Loading branch information
sebastian-philipp committed Dec 3, 2020
1 parent 0aca9c6 commit dac31fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion registries_conf_ctl/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def _extend(d, key, what):
if key not in d:
d[key] = [what]
else:
d[key].add(what)
d[key] = list(set(d[key] + [what]))


class DockerDaemonJson(Fmt):
Expand Down
5 changes: 5 additions & 0 deletions tests/test_add_mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,14 @@ def test_add_mirror(test_input, expected, cls, tmpdir):
fmt.add_mirror('docker.io', 'vossi04.front.sepia.ceph.com:5000', True, True)
assert fmt.config == expected


p = tmpdir.join("conf.conf")
p.write(test_input)

subprocess.check_call('registries-conf-ctl --conf {p} add-mirror docker.io vossi04.front.sepia.ceph.com:5000 --insecure --http'.format(p=p), shell=True)

assert cls(p).config == expected

subprocess.check_call('registries-conf-ctl --conf {p} add-mirror docker.io vossi04.front.sepia.ceph.com:5000 --insecure --http'.format(p=p), shell=True)

assert cls(p).config == expected

0 comments on commit dac31fe

Please sign in to comment.