Skip to content
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

Fixed docker facts to check for active swarm clusters before running docker swarm sub-commands. #817

Merged
merged 5 commits into from
May 31, 2022

Conversation

nmaludy
Copy link
Contributor

@nmaludy nmaludy commented Apr 5, 2022

Closes #702

Previously the docker facts would run docker swarm commands without knowing if the node was a member of a swarm cluster. This generated errors in /var/log/messages every time facts were collected.

The fix is to check if the node is a member of an active swarm cluster before trying to run the swarm commands. Inspired by: https://stackoverflow.com/questions/43053013/how-do-i-check-that-a-docker-host-is-in-swarm-mode

@nmaludy nmaludy requested a review from a team as a code owner April 5, 2022 15:20
@nmaludy nmaludy force-pushed the bugfix/docker-swarm-facts branch 4 times, most recently from 0901767 to 79cdebe Compare April 5, 2022 15:49
@nmaludy nmaludy force-pushed the bugfix/docker-swarm-facts branch from 79cdebe to 81a9af0 Compare April 5, 2022 16:01
end
val
end
end


Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this came back after your latest merge

Copy link
Contributor

@chelnak chelnak left a comment

Choose a reason for hiding this comment

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

This looks fine. Can you remove the extra new line that has been added in docker.rb:124 please?

Then we can get this one merged.

Co-authored-by: Craig Gumbley <[email protected]>
@nmaludy
Copy link
Contributor Author

nmaludy commented May 31, 2022

@chelnak Done.

chelnak
chelnak previously approved these changes May 31, 2022
@chelnak
Copy link
Contributor

chelnak commented May 31, 2022

Hmm looks like some rubocop warnings have popped up, could you take a look?

https://github.com/puppetlabs/puppetlabs-docker/runs/6669799337?check_suite_focus=true

@nmaludy nmaludy force-pushed the bugfix/docker-swarm-facts branch from 7c6c2f4 to a8d8858 Compare May 31, 2022 16:13
@chelnak
Copy link
Contributor

chelnak commented May 31, 2022

Thank you for your contribution 🙏 👍

@chelnak chelnak added the bugfix label May 31, 2022
@chelnak chelnak merged commit f372075 into puppetlabs:main May 31, 2022
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 2, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 2, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 2, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 2, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 2, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 3, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 3, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 3, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 3, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 3, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 3, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 4, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 4, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 5, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 8, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 9, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 10, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 12, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 15, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 16, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 16, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 16, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 16, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 17, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 17, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 22, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 22, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 22, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 22, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 24, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 25, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 26, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
jhoblitt added a commit to lsst-it/lsst-control that referenced this pull request Aug 26, 2022
The 4.4.0 release incorporates puppetlabs/puppetlabs-docker#783.

It also includes a fix for the docker swarm facts generating error
messages in syslog. puppetlabs/puppetlabs-docker#817
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why module want connect to Swarm API?
4 participants