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

Include auto-update label in generate kube #9763

Closed
jwillikers opened this issue Mar 19, 2021 · 9 comments · Fixed by #10202
Closed

Include auto-update label in generate kube #9763

jwillikers opened this issue Mar 19, 2021 · 9 comments · Fixed by #10202
Assignees
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@jwillikers
Copy link
Contributor

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

/kind feature

Description

I noticed that the label for auto-updates is not exported in podman generate kube.
I'd like to be able to export a Kubernetes YAML file and import it back into Podman and get the same results.

Steps to reproduce the issue:

1.Create a container with the auto-update label.

$ podman run -d --pod "new:test-autoupdate-pod" --label io.containers.autoupdate=image --name test-autoupdate-ctr alpine
  1. Confirm that the label is present for the container.
$ podman inspect test-autoupdate-ctr 
...
"Labels": {
    "io.containers.autoupdate": "image"
},
...
  1. Export the pod with generate kube.
$ podman generate kube test-autoupdate-pod
# Generation of Kubernetes YAML is still under development!
#
# Save the output of this file and use kubectl create -f to import
# it into Kubernetes.
#
# Created with podman-3.1.0-dev
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: "2021-03-19T11:45:11Z"
  labels:
    app: test-autoupdate-pod
  name: test-autoupdate-pod
spec:
  containers:
  - command:
    - /bin/sh
    env:
    - name: PATH
      value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    - name: TERM
      value: xterm
    - name: container
      value: podman
    image: docker.io/library/alpine:latest
    name: test-autoupdate-ctr
    resources: {}
    securityContext:
      allowPrivilegeEscalation: true
      capabilities:
        drop:
        - CAP_MKNOD
        - CAP_NET_RAW
        - CAP_AUDIT_WRITE
      privileged: false
      readOnlyRootFilesystem: false
      seLinuxOptions: {}
    workingDir: /
  dnsConfig: {}
  restartPolicy: Never
status: {}
  1. Note the absence of the auto-update label.

Describe the results you received:

Exporting the Kubernetes YAML resulted in a configuration missing the label io.containers.autoupdate: image.

Describe the results you expected:

I expected the container to be exported with the label io.containers.autoupdate: image.

Output of podman version:

Version:      3.1.0-dev
API Version:  3.1.0-dev
Go Version:   go1.15.8
Git Commit:   c4a551373004219fd2d50e5b055dbc5e233e4e32
Built:        Fri Mar 19 06:31:42 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.19.8
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.0.26-1.fc33.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.26, commit: 777074ecdb5e883b9bec233f3630c5e7fa37d521'
  cpus: 8
  distribution:
    distribution: fedora
    version: "33"
  eventLogger: journald
  hostname: localhost.localdomain
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.10.23-200.fc33.x86_64
  linkmode: dynamic
  memFree: 731537408
  memTotal: 4284538880
  ociRuntime:
    name: crun
    package: crun-0.18-1.fc33.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.18
      commit: 808420efe3dc2b44d6db9f1a3fac8361dde42a95
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /run/user/1000/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: true
    seccompEnabled: true
    selinuxEnabled: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.1.9-1.fc33.x86_64
    version: |-
      slirp4netns version 1.1.9
      commit: 4e37ea557562e0d7a64dc636eff156f64927335e
      libslirp: 4.3.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.0
  swapFree: 2142236672
  swapTotal: 2142236672
  uptime: 38m 37.14s
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
  - docker.io
store:
  configFile: /home/jordan/.config/containers/storage.conf
  containerStore:
    number: 2
    paused: 0
    running: 1
    stopped: 1
  graphDriverName: btrfs
  graphOptions: {}
  graphRoot: /home/jordan/.local/share/containers/storage
  graphStatus:
    Build Version: 'Btrfs v5.10 '
    Library Version: "102"
  imageStore:
    number: 2
  runRoot: /run/user/1000/containers
  volumePath: /home/jordan/.local/share/containers/storage/volumes
version:
  APIVersion: 3.1.0-dev
  Built: 1616153502
  BuiltTime: Fri Mar 19 06:31:42 2021
  GitCommit: c4a551373004219fd2d50e5b055dbc5e233e4e32
  GoVersion: go1.15.8
  OsArch: linux/amd64
  Version: 3.1.0-dev

Package info (e.g. output of rpm -q podman or apt list podman):

Built from source.

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

Yes

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

Running inside a GNOME Boxes VM.

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 19, 2021
@rhatdan
Copy link
Member

rhatdan commented Mar 22, 2021

Interested in opening a PR?

@rhatdan rhatdan added the Good First Issue This issue would be a good issue for a first time contributor to undertake. label Mar 22, 2021
@jwillikers
Copy link
Contributor Author

Yeah, I should be able to start looking into it this weekend, and since I'm a bit more familiar with that part of the code now it shouldn't be too difficult.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Apr 22, 2021

@jwillikers DId you ever get a chance to work on this?

@jwillikers
Copy link
Contributor Author

@rhatdan Unfortunately, I haven't been able to work on it!

@haircommander
Copy link
Collaborator

An option we have here is there's a common idiom having an annotation of the form $annotation/$ctrName: $value. podman could add/process io.containers.autoupdate/test-autoupdate-ctr=image in a similar way, or interpret io.containers.autoupdate=image as being for the whole pod

@EduardoVega
Copy link
Contributor

Can this be assigned to me?

@jwillikers
Copy link
Contributor Author

@EduardoVega Go for it!

@mheon
Copy link
Member

mheon commented Apr 25, 2021

@EduardoVega done

@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 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants