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

kube generate -> play fails due name already in use #2445

Closed
ikke-t opened this issue Feb 26, 2019 · 2 comments
Closed

kube generate -> play fails due name already in use #2445

ikke-t opened this issue Feb 26, 2019 · 2 comments
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.

Comments

@ikke-t
Copy link

ikke-t commented Feb 26, 2019

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

/kind bug

Description

podman fails to start pod with pod name same as container name. This is from yaml podman generate kube created.

Steps to reproduce the issue:

  1. create pod
sudo podman run -d  --name postgres \
 -e POSTGRES_USER=pg \
 -e POSTGRES_PASSWORD=pg \
 -e POSTGRES_DB=test \
 -e PGDATA="/var/lib/postgresql/data/pgdata" \
 postgres:9.6
  1. generate kube
sudo podman generate kube postgres > postgres.yml
  1. Delete pod
$ sudo podman pod rm -f postgres
b13caa435916e79f45131fe816270eb93ce893e064b3c226702f82775721308c
  1. try playing back the kube yaml
sudo podman play kube postgres.yml 

Describe the results you received:

$ sudo podman  rm -f postgres
d9aeba5043379cfc1db9ffeb722b8fa9a998150a90add978186acc2b24334604
$ sudo podman play kube postgres.yml 
b13caa435916e79f45131fe816270eb93ce893e064b3c226702f82775721308c
Error: name postgres is in use: container already exists

Describe the results you expected:

postgres to start

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

Output of podman version:

sudo yum install https://kojipkgs.fedoraproject.org//packages/podman/1.0.1/38.dev.gitcf52144.fc31/x86_64/podman-1.0.1-38.dev.gitcf52144.fc31.x86_64.rpm

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.12rc1
  podman version: 1.0.1-dev
host:
  BuildahVersion: "1.7"
  Conmon:
    package: podman-1.0.1-38.dev.gitcf52144.fc31.x86_64
    path: /usr/libexec/podman/conmon
    version: 'conmon version 1.12.0-dev, commit: b3ddd847a8d3802a2dcbf0e3fc632fb136a569c6'                                                        
  Distribution:
    distribution: fedora
    version: "29"
  MemFree: 196767744
  MemTotal: 8052445184
  OCIRuntime:
    package: runc-1.0.0-68.dev.git6635b4f.fc29.x86_64
    path: /usr/bin/runc
    version: |-
      runc version 1.0.0-rc6+dev
      commit: ef9132178ccc3d2775d4fb51f1e431f30cac1398-dirty
      spec: 1.0.1-dev
  SwapFree: 8017932288
  SwapTotal: 8199860224
  arch: amd64
  cpus: 4
  hostname: ohuska.localdomain
  kernel: 4.20.6-200.fc29.x86_64
  os: linux
  rootless: false
  uptime: 72h 14m 29.43s (Approximately 3.00 days)
insecure registries:
  registries: []
registries:
  registries:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  ConfigFile: /etc/containers/storage.conf
  ContainerStore:
    number: 3
  GraphDriverName: overlay
  GraphOptions:
  - overlay.mountopt=nodev
  GraphRoot: /var/lib/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 11
  RunRoot: /var/run/containers/storage

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

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 26, 2019
@ikke-t
Copy link
Author

ikke-t commented Feb 26, 2019

I was actually trying to reproduce the bug that podman couldn't create pod from it's own generated kube yaml. Yaml is in here: #2303 (comment)

This was supposed to be simple reproducal for @baude, who got this result from yaml playback:


18:16:17 | <@baude> | ikkeT, the postgres container dies with:
-- | -- | --
18:16:23 | <@baude> | /usr/local/bin/docker-entrypoint.sh: line 75: initdb: command not found
18:17:25 | <@baude> | ikkeT,  the rabbit one fails with :
18:17:28 | <@baude> | /usr/local/bin/docker-entrypoint.sh: line 345: rabbitmq-plugins: command not found
18:17:35 | <@baude> | /usr/local/bin/docker-entrypoint.sh: line 381: exec: rabbitmq-server: not found
18:18:03 | <@baude> | and memcached failed with:
18:18:06 | <@baude> | can't run as root without the -u switch

@ikke-t
Copy link
Author

ikke-t commented Mar 5, 2019

@baude fixed this by changing the name of pod during play if there is name collission. Pod becomes named "-pod" at the end of name to make names different. I tested this and it works for me. Thanks

@ikke-t ikke-t closed this as completed Mar 5, 2019
@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 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 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.
Projects
None yet
Development

No branches or pull requests

2 participants