saltstack / saltstack/salt

[BUG] salt.states.docker_image.present( insecure_registry=True) failed

Open
#61,486 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description

insecure_registry args is not working and got below error message

2022-01-19 13:55:28,118 [salt.state       :322 ][ERROR   ][28891] Encountered error pulling docker-registry.docker-registry.svc.cluster.local:5000:1.3.11: Unable to perform pull: pull() got an unexpected keyword argument 'insecure_registry'

and this error is bcz of docker python module doesn't support such arg. (https://docker-py.readthedocs.io/en/stable/api.html)

Setup

ic.pull.image:
  docker_image.present:
    - name: {{ api['image'] }}:{{ api['tag'] }}
    - insecure_registry: True
    - force: True

Please be as specific as possible and give set-up details.

  • [ x] on-prem machine
  • VM (Virtualbox, KVM, etc. please specify)
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD

Steps to Reproduce the behavior
(Include debug logs if possible and relevant)
run docker state or module with insecure_registry=True

Expected behavior

docker pull should work with given args as salt documents described
https://docs.saltproject.io/en/3003/ref/states/all/salt.states.docker_image.html
https://docs.saltproject.io/en/3003/ref/modules/all/salt.modules.dockermod.html

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3003.3
 
Dependency Versions:
          cffi: Not Installed
      cherrypy: unknown
      dateutil: 2.7.3
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.10
       libgit2: 0.27.7
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 0.5.6
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.19
      pycrypto: Not Installed
  pycryptodome: 3.6.1
        pygit2: 0.27.4
        Python: 3.7.3 (default, Jan 22 2021, 20:04:44)
  python-gnupg: Not Installed
        PyYAML: 3.13
         PyZMQ: 17.1.2
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.1
 
System Versions:
          dist: debian 10 buster
        locale: utf-8
       machine: x86_64
       release: 5.4.109+
        system: Linux
       version: Debian GNU/Linux 10 buster

Python 3.6.13 (default, Mar 10 2021, 18:30:35) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.

import docker
docker.version
'5.0.3'

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with salt.states.docker_image.present and salt.modules.dockermod, then compare their insecure_registry handling with the Docker Python client's pull API. Reproduce the documented docker_image.present example using Salt 3003.3 and docker 5.0.3; done means the pull no longer passes an unsupported argument and works with insecure_registry=True.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.