-
Notifications
You must be signed in to change notification settings - Fork 319
Fact "docker": undefined method []' for nil:NilClass on RHEL-8(docker-podman) #749
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
Comments
I'm having similar problems on Windows and Ubuntu after upgrading to 4.1.1 from and older version. |
I'm also having this error show up on Centos 7 systems that don't have docker installed. New behavior in 4.1.1. |
This issue has been marked as stale because it has been open for a while and has had no recent activity. If this issue is still important to you please drop a comment below and we will add this to our backlog to complete. Otherwise, it will be closed in 7 days. |
This appears to have been fixed with #773. |
This was broken in a different way for us when going from C7 to C8, 773 did not fix. Looks like in the This is where I had to change it, fwiw. I'm sure there is a better way of doing this...so I'm just leaving this for anyone that hits this. index b7cb379b54..d3a674b0c6 100644
--- a/docker/lib/facter/docker.rb
+++ b/docker/lib/facter/docker.rb
@@ -92,7 +92,12 @@ Facter.add(:docker) do
docker_network_names.each do |network|
inspect = JSON.parse(Facter::Util::Resolution.exec("#{docker_command} network inspect #{network}"))
docker['network'][network] = inspect[0]
- network_id = docker['network'][network]['Id'][0..11]
+ # support docker and podman. Podman outputs lowercase id
+ if docker['network'][network].key?('id')
+ network_id = docker['network'][network]['id'][0..11]
+ else
+ network_id = docker['network'][network]['Id'][0..11]
+ end |
Hello! 👋 This issue has been open for a while and has had no recent activity. We've labelled it with If you are waiting on a response from us we will try and address your comments on a future Community Day. Alternatively, if it is no longer relevant to you please close the issue with a comment. |
Describe the Bug
Error in facter when use podman-docker.rpm on RHEL-8
Expected Behavior
Add support for podman to /opt/puppetlabs/puppet/cache/lib/facter/docker.rb
Steps to Reproduce
install podman-docker.noarch from repo os-rhel8-appstream
run
puppet agent -t
or run
/opt/puppetlabs/puppet/bin/facter --custom-dir /opt/puppetlabs/puppet/cache/lib/facter/ -d docker
Environment
Additional Context
The text was updated successfully, but these errors were encountered: