Skip to content

Commit

Permalink
containers: Do not overwrite daemon.json
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed Nov 25, 2024
1 parent 2d65f9a commit 9af660e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/containers/docker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ sub configure_insecure_registries {
# The debug output is messing with terminal in migration tests
my $debug = (get_var('UPGRADE')) ? 'false' : 'true';
# Allow our internal 'insecure' registry only if REGISTRY variable is set
my $str = '{ \"debug\": ' . $debug;
$str .= get_var('REGISTRY') ? ', \"insecure-registries\" : [\"' . $registry . '\"] }' : '}';
my $config = script_output("echo $str | tee /etc/docker/daemon.json");
record_info('daemon.json', $config);
assert_script_run "sed -i 's%^{%&\"debug\":$debug,\"insecure-registries\":[\"$registry\"],%' /etc/docker/daemon.json";
record_info('daemon.json', script_output(" /etc/docker/daemon.json");
systemctl('restart docker');
}

Expand Down

0 comments on commit 9af660e

Please sign in to comment.