Skip to content

fix(config): write config dictionary to daemon.json#282

Merged
noelmcloughlin merged 6 commits intosaltstack-formulas:masterfrom
danny-smit:configure-daemon-json-file
Apr 21, 2021
Merged

fix(config): write config dictionary to daemon.json#282
noelmcloughlin merged 6 commits intosaltstack-formulas:masterfrom
danny-smit:configure-daemon-json-file

Conversation

@danny-smit
Copy link
Contributor

@danny-smit danny-smit commented Apr 20, 2021

PR progress checklist (to be filled in by reviewers)

  • Changes to documentation are appropriate (or tick if not required)
  • Changes to tests are appropriate (or tick if not required)
  • Reviews completed

What type of PR is this?

Primary type

  • [build] Changes related to the build system
  • [chore] Changes to the build process or auxiliary tools and libraries such as documentation generation
  • [ci] Changes to the continuous integration configuration
  • [feat] A new feature
  • [fix] A bug fix
  • [perf] A code change that improves performance
  • [refactor] A code change that neither fixes a bug nor adds a feature
  • [revert] A change used to revert a previous commit
  • [style] Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)

Secondary type

  • [docs] Documentation changes
  • [test] Adding missing or correcting existing tests

Does this PR introduce a BREAKING CHANGE?

No

Related issues and/or pull requests

Bug: Can't manage /etc/docker/daemon.json using pillar syntax in v1.0.0 (#257)

Describe the changes you're proposing

This change makes the pillar key daemon_config update the /etc/docker/daemon.json.

Pillar / config required to test the proposed changes

Fictive example configuration:

docker:
  pkg:
    docker:
      daemon_config:         
        debug: true                             
        tls: true                               
        tlscert: "/var/docker/server.pem"       
        tlskey: "/var/docker/serverkey.pem"     
        hosts:                                  
          - tcp://192.168.59.3:2376             

Debug log showing how the proposed changes work

Documentation checklist

  • Updated the README (e.g. Available states).
  • Updated pillar.example.

Testing checklist

  • Included in Kitchen (i.e. under state_top).
  • Covered by new/existing tests (e.g. InSpec, Serverspec, etc.).
  • Updated the relevant test pillar.

Additional context

@danny-smit
Copy link
Contributor Author

I just noticed that, according to the toplevel README, the config keys are meant to do the same as the environ keys?! That would imply that introducing daemon_config key would be better.

@danny-smit danny-smit force-pushed the configure-daemon-json-file branch from 5a238e0 to 6755e4a Compare April 21, 2021 12:56
An empty daemon.json isn't accepted on some OS/docker versions
@danny-smit danny-smit force-pushed the configure-daemon-json-file branch from 6755e4a to 3631fdb Compare April 21, 2021 13:30
@myii
Copy link
Contributor

myii commented Apr 21, 2021

Thanks for the PR, @danny-smit.

@noelmcloughlin @hatifnatt Would either of you mind reviewing this PR, since you've both been recently active here?

Copy link
Contributor

@noelmcloughlin noelmcloughlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. CI passing. Fixes bug #257 thanks @danny-smit

Please add a CI test in future PR if you have time.

@keslerm
Copy link
Contributor

keslerm commented Apr 21, 2021

Thanks @danny-smit this is a big one for us couldn't have had better timing

@saltstack-formulas-travis

🎉 This PR is included in version 2.0.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants