Skip to content

Commit

Permalink
Merge pull request #284 from danny-smit/tests-for-daemon-json-file
Browse files Browse the repository at this point in the history
fix(config): remove daemon.json in clean states
  • Loading branch information
myii authored Apr 23, 2021
2 parents 2c7fe1a + 6967a98 commit 03250b4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions docker/software/config/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ include:
- names:
- {{ d.pkg.docker.config_file }}
- {{ d.pkg.docker.environ_file }}
- {{ d.pkg.docker.daemon_config_file }}
- require:
- sls: {{ sls_archive_clean if d.pkg.docker.use_upstream == 'archive' else sls_package_clean }}
1 change: 1 addition & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ docker:
# yamllint enable-line rule:line-length
- DOCKER_OPTS="-s btrfs --dns 8.8.8.8"
- export http_proxy="http://172.17.42.1:3128"
daemon_config: {}

networks:
- nginxnet
Expand Down
3 changes: 3 additions & 0 deletions test/integration/archive/controls/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@
its('content') { should include 'DOCKER_OPTS="-s btrfs --dns 8.8.8.8"' }
its('content') { should include 'export http_proxy="http://172.17.42.1:3128"' }
end
describe file('/etc/docker/daemon.json') do
it { should_not exist }
end
end
3 changes: 3 additions & 0 deletions test/integration/clean/controls/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
describe file('/etc/default/docker') do
it { should_not exist }
end
describe file('/etc/docker/daemon.json') do
it { should_not exist }
end
end
7 changes: 7 additions & 0 deletions test/integration/package/controls/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,11 @@
its('content') { should include 'DOCKER_OPTS="-s btrfs --dns 8.8.8.8"' }
its('content') { should include 'export http_proxy="http://172.17.42.1:3128"' }
end
describe file('/etc/docker/daemon.json') do
it { should be_file }
its('owner') { should eq 'root' }
its('group') { should eq 'root' }
its('mode') { should cmp '0640' }
its('content') { should include '"insecure-registries": []' }
end
end
2 changes: 2 additions & 0 deletions test/salt/pillar/package.sls
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ docker:
# yamllint disable-line rule:line-length
- DOCKER_OPTS="-s btrfs --dns 8.8.8.8"
- export http_proxy="http://172.17.42.1:3128"
daemon_config:
insecure-registries: []

containers:
running:
Expand Down

0 comments on commit 03250b4

Please sign in to comment.