Bug 1389255

Summary: [platformmanagement_public_806] Evict endpoint getting: Resource was marked with kind Pod but was unable to be converted
Product: OpenShift Container Platform Reporter: Chuan Yu <chuyu>
Component: MasterAssignee: Maciej Szulik <maszulik>
Status: CLOSED CURRENTRELEASE QA Contact: Chuan Yu <chuyu>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.4.0CC: aos-bugs, jokerman, mmccomas
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Antiaffinity admission plugin did not allow submitting anything to pod subresources, here pods/evicton. Consequence: It's impossible to evict a pod. Fix: Update antiaffinity admission plugin to ignore calls to pod's soubresources. Result: Pod eviction is working as expected.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-08 18:39:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Chuan Yu 2016-10-27 09:49:14 UTC
Description of problem:
Evict pods failed, and get "message": "Resource was marked with kind Pod but was unable to be converted".

Version-Release number of selected component (if applicable):
openshift v3.4.0.16+cc70b72

How reproducible:
Always

Steps to Reproduce:
1.Try to evict existed pod by curl cmd, such as:
curl -k -v -X POST -H "Authorization: Bearer $(oc whoami -t)" -H 'Content-type: application/json' https://127.0.0.1:8443/api/v1/namespaces/default/pods/pod-5/eviction -d @eviction.json
{ 
  "apiVersion": "policy/v1alpha1", 
  "kind": "Eviction", 
  "metadata": { 
    "name": "pod-1", 
    "namespace": "default" 
  } 
} 


Actual results:
{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "Resource was marked with kind Pod but was unable to be converted",
  "reason": "BadRequest",
  "code": 400
}

Expected results:
No such messages return, the cmd should be run successful or fail.

Additional info:

Comment 1 Maciej Szulik 2016-10-27 10:23:28 UTC
Fix in https://github.com/openshift/origin/pull/11578 is waiting upstream approval.

Comment 2 Chuan Yu 2016-11-04 02:52:37 UTC
Checked with openshift v1.4.0-alpha.0+777e66f-1137, the issue was fixed. 
Will check with OCP later.

Comment 3 Chuan Yu 2016-11-08 06:10:28 UTC
Checked with the OCP latest verion, the issue was fixed.
openshift v3.4.0.23+24b1a58
kubernetes v1.4.0+776c994
etcd 3.1.0-rc.0