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

Fix play kube command in pod yaml #3809

Merged
merged 1 commit into from
Aug 14, 2019

Conversation

chenzhiwei
Copy link
Contributor

This PR fixes the play kube can't recognize command setting in pod yaml file.

The initial issue was fixed in: #3588

But it was introduced again in: #3744

/assign @haircommander @mheon

@openshift-ci-robot
Copy link
Collaborator

Hi @chenzhiwei. Thanks for your PR.

I'm waiting for a containers or openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 14, 2019
@rh-atomic-bot
Copy link
Collaborator

Can one of the admins verify this patch?
I understand the following commands:

  • bot, add author to whitelist
  • bot, test pull request
  • bot, test pull request once

@haircommander
Copy link
Collaborator

LGTM, @mheon I wonder why this wasn't caught in tests 🤔

@haircommander
Copy link
Collaborator

bot, add author to whitelist
/ok-to-test
thanks for the PR @chenzhiwei

@openshift-ci-robot openshift-ci-robot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 14, 2019
@haircommander
Copy link
Collaborator

@chenzhiwei I am trying to write a test case that replicates the problem, but can't on the current master. if I have the kube yaml:

# 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-1.4.5-dev
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: "2019-08-14T12:27:01Z"
  labels:
    app: hello
  name: hello
spec:
  containers:
  - command:
    - /bin/sh
    - -c
    - echo "hello"
    env:
    - name: PATH
      value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    - name: TERM
      value: xterm
    - name: HOSTNAME
    - name: container
      value: podman
    image: docker.io/library/alpine:latest
    name: wonderfulpoincare
    resources: {}
    securityContext:
      allowPrivilegeEscalation: true
      capabilities: {}
      privileged: false
      readOnlyRootFilesystem: false
    workingDir: /
status: {}

and play kube with it, I can then run
podman logs -l
and get "hello" back

How did you find this problem?

Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This smells like a bad merge somewhere....

@TomSweeneyRedHat
Copy link
Member

LGTM, if we could add a test, either in this PR or another to watch for another regression, it would probably be a good idea.

@TomSweeneyRedHat
Copy link
Member

and forgot the most important thing, Thanks @chenzhiwei !

@chenzhiwei
Copy link
Contributor Author

@haircommander Which version did you use?

Mine is:

root@ubuntu:~# podman version
Version:            1.5.0
RemoteAPI Version:  1
Go Version:         go1.10.4
OS/Arch:            linux/amd64

And use your yaml file, I got:

root@ubuntu:~# podman ps -a
CONTAINER ID  IMAGE                            COMMAND               CREATED         STATUS                     PORTS  NAMES
cac3c431eb10  docker.io/library/alpine:latest  /bin/sh               20 seconds ago  Exited (0) 19 seconds ago         wonderfulpoincare
bd57c8608ebd  k8s.gcr.io/pause:3.1                                   25 seconds ago  Up 20 seconds ago                 8197b58ea5f2-infra

@mheon
Copy link
Member

mheon commented Aug 14, 2019 via email

@haircommander
Copy link
Collaborator

@chenzhiwei confirmed ps shows the wrong output. This has the side effect of a regression in generate kube where the command isn't properly set...

I have a test case attached, can you apply it with git apply -f play-patch.txt
play-patch.txt

@haircommander
Copy link
Collaborator

haha whoops, you'll need to run make gofmt and commit the changes

@haircommander
Copy link
Collaborator

LGTM assuming the test passes :) thanks a bunch @chenzhiwei
@mheon added Release Notes 1.5.1 to make sure this gets in :)

@mheon
Copy link
Member

mheon commented Aug 14, 2019

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chenzhiwei, mheon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 14, 2019
@chenzhiwei
Copy link
Contributor Author

@haircommander Sorry, I did not verify the final result, it was just a display error.

I have vim-go installed, usually there should be no format error, but for this patch I did not use vim to edit it. :(

@haircommander
Copy link
Collaborator

no worries at all 😃

@haircommander
Copy link
Collaborator

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 14, 2019
@openshift-merge-robot openshift-merge-robot merged commit 4823cf8 into containers:master Aug 14, 2019
@chenzhiwei chenzhiwei deleted the fix-play-kube branch August 14, 2019 14:22
@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 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. ok-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants