Skip to content
This repository was archived by the owner on Oct 10, 2020. It is now read-only.
This repository was archived by the owner on Oct 10, 2020. It is now read-only.

(atomic sign) does not work at all #929

@mtrmac

Description

@mtrmac
  1. Traceback (most recent call last):
      File "./atomic", line 189, in <module>
        sys.exit(_func())
      File "/home/mitr/t/atomic/Atomic/sign.py", line 80, in sign
        manifest = ri.get_manifest()
      File "/home/mitr/t/atomic/Atomic/discovery.py", line 41, in get_manifest
        assert(self.fqdn is not None)
    AssertionError
    

    Apparently it is necessary to call ri.inspect() before ri.get_manifest(); though a clean fix would probably be different, at the very least it would be nice to skip util.skopeo_inspect if self.registry is specified in the input argument.

  2. After adding a _ = ri.inspect() in there:

    $ ATOMIC_CONF=tests/unit/fixtures/atomic.conf ATOMIC_CONFD=/var/empty/ sudo -E ./atomic --debug sign --sign-by=mitr@volny.cz -d . docker.io/library/busybox:latest
    …
    Traceback (most recent call last):
      File "./atomic", line 189, in <module>
        sys.exit(_func())
      File "/home/mitr/t/atomic/Atomic/sign.py", line 85, in sign
        manifest_file.write(manifest)
    TypeError: argument 1 must be string or buffer, not dict
    

    It seems RegistryInspect.get_manifest should use return_json=False, not True.

  3. Also (after the _ = ri.inspect() workaround), only with --debug:

    $ ATOMIC_CONF=tests/unit/fixtures/atomic.conf ATOMIC_CONFD=/var/empty/ sudo -E ./atomic --debug sign --sign-by=mitr@volny.cz -d . busybox:latest
    …
    Traceback (most recent call last):
      File "./atomic", line 189, in <module>
        sys.exit(_func())
      File "/home/mitr/t/atomic/Atomic/sign.py", line 79, in sign
        _ = ri.inspect()
      File "/home/mitr/t/atomic/Atomic/discovery.py", line 34, in inspect
        self.fqdn = self.find_image_on_registry()
      File "/home/mitr/t/atomic/Atomic/discovery.py", line 70, in find_image_on_registry
        util.write_out(i)
      File "/home/mitr/t/atomic/Atomic/util.py", line 189, in write_out
        _output(sys.stdout, output, lf)
      File "/home/mitr/t/atomic/Atomic/util.py", line 202, in _output
        fd.write(output + lf)
    TypeError: unsupported operand type(s) for +: 'dict' and 'str'
    
  4. After fixing the above:

    $ ATOMIC_CONF=tests/unit/fixtures/atomic.conf ATOMIC_CONFD=/var/empty/ sudo -E ./atomic --debug sign --sign-by=mitr@volny.cz busybox:latest
    ...
    Traceback (most recent call last):
     File "./atomic", line 189, in <module>
       sys.exit(_func())
     File "/home/mitr/t/atomic/Atomic/sign.py", line 103, in sign
       signature_path = util.get_signature_write_path(reg_info)
     File "/home/mitr/t/atomic/Atomic/util.py", line 671, in get_signature_write_path
       return reg_info.get('sigstore-staging', reg_info.get('sigstore', None))
    AttributeError: 'NoneType' object has no attribute 'get'
    

    Unhandled the case when reg_info = None and default_store = None

  5. Adding an error message in there ends up with:

    $ ATOMIC_CONF=tests/unit/fixtures/atomic.conf ATOMIC_CONFD=/var/empty/ sudo -E ./atomic --debug sign --sign-by=mitr@volny.cz centos/httpd:latest
    …
    Trying docker.io/centos/httpd:latest...
    No applicable configuration for /centos was found in tests/unit/fixtures/etc/containers/registries.d
    

    Apparently expanded_image_name ends up as /centos/httpd:latest. I don’t immediately see how the RegistryInspect class is supposed to work with .fqdn, .registry etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions