garethr-docker
garethr-docker copied to clipboard
Adding support for Docker service 'After' attribute in Unit file
This is a pull request for: https://github.com/garethr/garethr-docker/issues/619
Hi @eyal-lupu. Thanks for your contribution! The PR is looking good, though we require a few things to move forward.
- There will need to be some spec tests to confirm your changes are behaving in the manner you expect.
An example is https://github.com/garethr/garethr-docker/pull/534/files#diff-57c32a956fccf5af23aba2bce1d74d1d.
- The commits will need to be squashed before they can be merged.
If you have any questions just let us know.
Hi @garethr
thank you for your response. I an not familiar with Ruby at all but reverse engineering the existing tests it seems that adding a test similar to the below should work
context 'with systemd service_unit_after' do
let(:params) { { 'service_unit_after' => 'network-online.target' } }
it { should contain_file(service_override_file).with_content(/After=network-online.target/) }
end
It does run but seems to be failing as the override files is missing:
- docker on RedHat with systemd service_unit_after should contain File[/etc/systemd/system/docker.service.d/service-overrides.conf] with content =~ /After=network-online.target/ Failure/Error: it { should contain_file(service_override_file).with_content(/After=network-online.target/) } expected that the catalogue would contain File[/etc/systemd/system/docker.service.d/service-overrides.conf] # ./spec/classes/docker_spec.rb:214:in `block (5 levels) in <top (required)>'
As I am really not familiar with that environment I am a bit blocked in here. If someone could enable the tests to create the file I will be more than happy to take that from there