-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(compose-ng): Added networks keyword support #251
Conversation
Best reviewed: commit by commit
Optimal code review plan
|
Apologies for the delayed reponse, @Exoyds. Unfortunately, there's no dedicated maintainer for this formula so things can take some time. Let's evaluate the situation for getting this merged:
|
I'm not using compose-ng (i prefer using docker-containers instead) from this formula but I can take a look. I think there is indeed a need to add some docker network states and this could be a valuable addition that could be shared across |
Really appreciate it, @kiniou. |
Thank you for looking into my PR! I completely understand the response time, after all we're contributing in our free time! As for the PR itself - as I have mentioned I have tested it myself on a small environment, but on nothing bigger, so if there are any issues on larger deployments I can try and fix them
This was because I missed a colon in the title when i initially submitted the PR, and I am not sure how to re-run the test. |
@Exoyds Also the capital -feat(compose-ng) Added networks keyword support
+feat(compose-ng): added networks keyword support
You can amend the commit at your end and then force-push to your branch (which is your |
401c7e2
to
e7a92c4
Compare
I've fixed all the Also I would very much appreciate any materials and pointers as I'm relatively new to contributing to other projects! |
@Exoyds Not to worry, you've done everything necessary from your end -- thanks for that. We need to upgrade to the latest CI images and that will get everything passing in Travis again. So now we're just waiting for any feedback that @kiniou has. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Exoyds 👋 (and sorry for the late review: back-to-work and life combo happened)
👍 LGTM and I just left a small comment about splitting the networks creation from the docker.compose-ng
SLS.
All in all, everything went well. I've tested your changes with a small Debian Buster machine with salt 3001 with the following pillar (not to far from pillar.example
):
docker:
networks:
- nginxnet
compose:
nginx:
image: nginx:latest
container_name: nginx
networks:
- nginxnet
ports:
- '80:80'
- '443:443'
mailhog:
image: mailhog/mailhog:latest
networks:
- nginxnet
ports:
- '8025:8025'
and I can see the containers attached to the network nginxnet
:
docker network inspect --format '{{json .Containers}}' nginxnet | jq .
{
"436b48d8a97513b346f31de96c3bc0c0ec397672518af91b7a263d452d6d1467": {
"Name": "nginx",
"EndpointID": "a85b966910a375a3e3b47091b2de8a8d29a790aadb18b6bdf8c2e3d873c8ba08",
"MacAddress": "02:42:ac:12:00:03",
"IPv4Address": "172.18.0.3/16",
"IPv6Address": ""
},
"a761cb61488de19c73eff579536f68bc907973c413e8e1ffee65a117108be86c": {
"Name": "mailhog",
"EndpointID": "9b9c4065e19f78817ffa2f67e3960cbc561e23a51e54cdd199f158a9b2e0c924",
"MacAddress": "02:42:ac:12:00:02",
"IPv4Address": "172.18.0.2/16",
"IPv6Address": ""
}
}
docker/compose-ng.sls
Outdated
{%- for networkname in networks %} | ||
{{ networkname }} network: | ||
docker_network.present: | ||
- name: {{ networkname }} | ||
{%- endfor %} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should go in a separate networks.sls
and just added to the list of include:
.
This will allow docker.containers to benefit from that (not related but can be done in another PR).
Also, there are other kinds of docker networks and this would be easier to handle them in a separate file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have now swapped it to a different file and added to networks.sls. It is indeed a good idea for future expansions!
Hi @kiniou, no worries, and thank you for your time! I'm glad to hear it worked! I have also made the changes as suggested in the review. |
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
Thanks for the PR! I have included this in #256 but the only difference is |
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
- align tom template formula - fix bugs - add Windows support - Add saltstack dockercompose module support - Get rid of confusing old legacy spagetti jinja conditionals - Travis CI (package/archive) is passing - Windows is passing - Fixes/obsoletes: saltstack-formulas#252, saltstack-formulas#249, saltstack-formulas#243, saltstack-formulas#236, saltstack-formulas#234, saltstack-formulas#219, saltstack-formulas#202, saltstack-formulas#191 - Fixes/obsoletes: saltstack-formulas#190, saltstack-formulas#160, saltstack-formulas#95, saltstack-formulas#85, saltstack-formulas#74 - Includes saltstack-formulas#251 and saltstack-formulas#253 - Add Swarm support BREAKING CHANGE: This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
Thank you for including my PR in the code! Should I close this one now? |
Thanks @Exoyds for the feedback, Yes, I will close this now. I actually updated the commit reverting to your design, so its |
# [1.0.0](v0.44.0...v1.0.0) (2020-11-18) ### Bug Fixes * **cent7:** install yum-plugin-versionlock too ([3b2e237](3b2e237)) * **clean:** do not remove python package ([e7ee880](e7ee880)) * **pillar.example:** fix `yamllint` violation [skip ci] ([31087af](31087af)), closes [#250](#250) * **state:** corrected remove state ([e178243](e178243)) ### Code Refactoring * **rewrite:** modernize formula and fresh start ([1e48667](1e48667)), closes [#252](#252) [#249](#249) [#243](#243) [#236](#236) [#234](#234) [#219](#219) [#202](#202) [#191](#191) [#190](#190) [#160](#160) [#95](#95) [#85](#85) [#74](#74) [#251](#251) [#253](#253) ### Continuous Integration * **kitchen:** use `saltimages` Docker Hub where available [skip ci] ([1755f38](1755f38)) * **pre-commit:** add to formula [skip ci] ([d04e24a](d04e24a)) * **pre-commit:** enable/disable `rstcheck` as relevant [skip ci] ([8454e4a](8454e4a)) * **pre-commit:** finalise `rstcheck` configuration [skip ci] ([87c737c](87c737c)) * **travis:** add notifications => zulip [skip ci] ([6222d60](6222d60)) ### Documentation * **macos:** updated pillar.example & macos hash ([fc011b3](fc011b3)) * **readme:** fix macos clean state ([fca7fea](fca7fea)) ### BREAKING CHANGES * **rewrite:** This version is not backwards compatible. Update your states and pillar data to align with new formula. - MacOS was not tested in this PR but hopefully no regression. - docker.containers: sls was simplified (raise PR if regression)
PR progress checklist (to be filled in by reviewers)
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 testsDoes this PR introduce a
BREAKING CHANGE
?No.
Related issues and/or pull requests
None as far as I could find.
Describe the changes you're proposing
I've added the support for the network keyword. So far it's just that with no support for aliases. I have also commented out links from pillar.example as it is a legacy feature that may be removed in future versions of docker.
Pillar / config required to test the proposed changes
Pillar.example is updated with the proposed change.
Debug log showing how the proposed changes work
`
`
Documentation checklist
README
(e.g.Available states
).pillar.example
.Testing checklist
state_top
).Additional context