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

remote: manifest add --annotation failed to add annotations field #15952

Closed
sstosh opened this issue Sep 27, 2022 · 7 comments · Fixed by #15988 or #16004
Closed

remote: manifest add --annotation failed to add annotations field #15952

sstosh opened this issue Sep 27, 2022 · 7 comments · Fixed by #15988 or #16004
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. remote Problem is in podman-remote

Comments

@sstosh
Copy link
Contributor

sstosh commented Sep 27, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

In help page, podman-remote manifest add --annotation option seems to be supported.
However, --annotation option doesn't work.

# podman-remote manifest add --help
Add images to a manifest list or image index

< ...snip... >

Options:
      --all                           add all of the list's images if the image is a list
      --annotation annotation         set an annotation for the specified image
      --arch architecture             override the architecture of the specified image
      --authfile string               path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override
      --creds [username[:password]]   use [username[:password]] for accessing the registry
      --features features             override the features of the specified image
      --os OS                         override the OS of the specified image
      --os-version version            override the OS version of the specified image
      --tls-verify                    require HTTPS and verify certificates when accessing the registry (default true)
      --variant Variant               override the Variant of the specified image

Steps to reproduce the issue:

# podman-remote manifest create test
44f340f882d25deee282e2d9abede61a030a922041d03105b02c22982f1fa8d6

# podman-remote manifest add --annotation foo=bar test quay.io/libpod/testimage:20220615
44f340f882d25deee282e2d9abede61a030a922041d03105b02c22982f1fa8d6

Describe the results you received:

# podman-remote manifest inspect test
{
    "schemaVersion": 2,
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "manifests": [
        {
            "mediaType": "application/vnd.oci.image.manifest.v1+json",
            "size": 758,
            "digest": "sha256:a07e678985cd67330fd30a4c8a008cefeb1ca917c25ab0f8468ea17c7b34beb2",
            "platform": {
                "architecture": "amd64",
                "os": "linux"
            }
        }
    ]
}

Describe the results you expected:

  1. If --annotation option isn't supported, we need to hide --annotation option from help page.
  2. If --annotation option is supported, add annotations field such as below.
# podman-remote manifest inspect test
{
    "schemaVersion": 2,
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "manifests": [
        {
            "mediaType": "application/vnd.oci.image.manifest.v1+json",
            "size": 758,
            "digest": "sha256:a07e678985cd67330fd30a4c8a008cefeb1ca917c25ab0f8468ea17c7b34beb2",
            "platform": {
                "architecture": "amd64",
                "os": "linux"
            },
            "annotations": {
                "foo": "bar"
            }
        }
    ]
}

Additional information you deem important (e.g. issue happens only occasionally):

Succeeded to add annotations field on local enviornment.

# podman manifest inspect test
{
    "schemaVersion": 2,
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "manifests": [
        {
            "mediaType": "application/vnd.oci.image.manifest.v1+json",
            "size": 758,
            "digest": "sha256:a07e678985cd67330fd30a4c8a008cefeb1ca917c25ab0f8468ea17c7b34beb2",
            "platform": {
                "architecture": "amd64",
                "os": "linux"
            },
            "annotations": {
                "foo": "bar"
            }
        }
    ]
}
podman-remote version
Client:       Podman Engine
Version:      4.3.0-dev
API Version:  4.3.0-dev
Go Version:   go1.18.3
Git Commit:   98e26278844506e64e311810f97bffcc7efc0b8a
Built:        Tue Sep 27 13:55:08 2022
OS/Arch:      linux/amd64

Server:       Podman Engine
Version:      4.3.0-dev
API Version:  4.3.0-dev
Go Version:   go1.18.3
Git Commit:   98e26278844506e64e311810f97bffcc7efc0b8a
Built:        Tue Sep 27 13:54:58 2022
OS/Arch:      linux/amd64
podman-remote info
host:
  arch: amd64
  buildahVersion: 1.28.0-dev
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - hugetlb
  - pids
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.0-2.fc36.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.0, commit: '
  cpuUtilization:
    idlePercent: 99.98
    systemPercent: 0.01
    userPercent: 0.01
  cpus: 12
  distribution:
    distribution: fedora
    variant: server
    version: "36"
  eventLogger: journald
  hostname: fedora36
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.18.11-200.fc36.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 6005047296
  memTotal: 8326590464
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun-1.5-1.fc36.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.5
      commit: 54ebb8ca8bf7e6ddae2eb919f5b82d1d96863dea
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: unix:///run/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-0.2.beta.0.fc36.x86_64
    version: |-
      slirp4netns version 1.2.0-beta.0
      commit: 477db14a24ff1a3de3a705e51ca2c4c1fe3dda64
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 8325689344
  swapTotal: 8325689344
  uptime: 124h 49m 14.00s (Approximately 5.17 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 106285760512
  graphRootUsed: 19557855232
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 1
  runRoot: /run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 4.3.0-dev
  Built: 1664254498
  BuiltTime: Tue Sep 27 13:54:58 2022
  GitCommit: 98e26278844506e64e311810f97bffcc7efc0b8a
  GoVersion: go1.18.3
  Os: linux
  OsArch: linux/amd64
  Version: 4.3.0-dev

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):
KVM, fedora36

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 27, 2022
@github-actions github-actions bot added the remote Problem is in podman-remote label Sep 27, 2022
@flouthoc
Copy link
Collaborator

I think this was fixed for podman here: #15069 , could you confirm if manifest annotate --annotation works or not ? Cause we have a test for manifest annotate so it could be just manifest add

@sstosh
Copy link
Contributor Author

sstosh commented Sep 27, 2022

I think this was fixed for podman here: #15069 , could you confirm if manifest annotate --annotation works or not ? Cause we have a test for manifest annotate so it could be just manifest add

manifest annotate --annotation isn't supported on remote environment.
In e2e tests, manifest annotate tests are skipped.

# podman-remote manifest annotate test quay.io/libpod/testimage:20220615
Error: cannot use command "podman-remote manifest annotate" with the remote podman client

@flouthoc
Copy link
Collaborator

Ah fair enough then I think this is not wired on the remote at all.

@sstosh
Copy link
Contributor Author

sstosh commented Sep 27, 2022

Ah fair enough then I think this is not wired on the remote at all.

I see, it means --annotation option isn't supported on remote environment.
I'll fix the help page.

@flouthoc
Copy link
Collaborator

@sstosh Yes I think entire annotate command is not yet implemented https://github.com/containers/podman/blob/main/pkg/domain/infra/tunnel/manifest.go#L81

@rhatdan
Copy link
Member

rhatdan commented Sep 27, 2022

This should be supported, lets fix the bug.

@sstosh
Copy link
Contributor Author

sstosh commented Sep 28, 2022

This should be supported, lets fix the bug.

Sure, I'll try to fix this bug.

sstosh added a commit to sstosh/podman that referenced this issue Sep 29, 2022
* `manifest add --annotation option` adds annotations
  field on remote environment.
* `manifest inspect` prints annotations field
  on remote environment.

Fixes: containers#15952

Signed-off-by: Toshiki Sonoda <[email protected]>
@sstosh sstosh removed their assignment Sep 30, 2022
openshift-merge-robot pushed a commit that referenced this issue Nov 10, 2022
* `manifest add --annotation option` adds annotations
  field on remote environment.
* `manifest inspect` prints annotations field
  on remote environment.

Fixes: #15952

Signed-off-by: Toshiki Sonoda <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. remote Problem is in podman-remote
Projects
None yet
3 participants