{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/40635","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/40635/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/40635/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/40635/events","html_url":"https://github.com/kubernetes/kubernetes/issues/40635","id":203763061,"node_id":"MDU6SXNzdWUyMDM3NjMwNjE=","number":40635,"title":"Unable to delete stale objects with `kubectl apply --prune` when no object passed in.","user":{"login":"MrHohn","id":8681801,"node_id":"MDQ6VXNlcjg2ODE4MDE=","avatar_url":"https://avatars0.githubusercontent.com/u/8681801?v=4","gravatar_id":"","url":"https://api.github.com/users/MrHohn","html_url":"https://github.com/MrHohn","followers_url":"https://api.github.com/users/MrHohn/followers","following_url":"https://api.github.com/users/MrHohn/following{/other_user}","gists_url":"https://api.github.com/users/MrHohn/gists{/gist_id}","starred_url":"https://api.github.com/users/MrHohn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrHohn/subscriptions","organizations_url":"https://api.github.com/users/MrHohn/orgs","repos_url":"https://api.github.com/users/MrHohn/repos","events_url":"https://api.github.com/users/MrHohn/events{/privacy}","received_events_url":"https://api.github.com/users/MrHohn/received_events","type":"User","site_admin":false},"labels":[{"id":138247961,"node_id":"MDU6TGFiZWwxMzgyNDc5NjE=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/kubectl","name":"area/kubectl","color":"0052cc","default":false},{"id":105146071,"node_id":"MDU6TGFiZWwxMDUxNDYwNzE=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/kind/bug","name":"kind/bug","color":"e11d21","default":false},{"id":450823910,"node_id":"MDU6TGFiZWw0NTA4MjM5MTA=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/cli","name":"sig/cli","color":"d2b48c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2017-01-27T23:09:53Z","updated_at":"2018-12-21T15:38:16Z","closed_at":null,"author_association":"MEMBER","body":"**What keywords did you search in Kubernetes issues before filing this one?** kubectl apply prune\r\n\r\n---\r\n\r\n**Is this a BUG REPORT or FEATURE REQUEST?** (FEATURE REQUEST):\r\n\r\n<!--\r\nIf this is a FEATURE REQUEST, please:\r\n  - Describe *in detail* the feature/behavior/change you'd like to see.\r\n\r\nIn both cases, be ready for followup questions, and please respond in a timely\r\nmanner.  If we can't reproduce a bug or think a feature already exists, we\r\nmight close your issue.  If we're wrong, PLEASE feel free to reopen it and\r\nexplain why.\r\n-->\r\n\r\n**Kubernetes version** (use `kubectl version`):\r\n\r\n```\r\nClient Version: version.Info{Major:\"1\", Minor:\"6+\", GitVersion:\"v1.6.0-alpha.0.3823+8444d47627df7d-dirty\", GitCommit:\"8444d47627df7d120c1641a3fe841480e10cb766\", GitTreeState:\"dirty\", BuildDate:\"2017-01-25T01:02:18Z\", GoVersion:\"go1.7\", Compiler:\"gc\", Platform:\"linux/amd64\"}\r\nServer Version: version.Info{Major:\"1\", Minor:\"6+\", GitVersion:\"v1.6.0-alpha.0.4057+b3f9be4656fe35-dirty\", GitCommit:\"b3f9be4656fe35642ea26271476cf79a349008e1\", GitTreeState:\"dirty\", BuildDate:\"2017-01-27T17:01:55Z\", GoVersion:\"go1.7.4\", Compiler:\"gc\", Platform:\"linux/amd64\"}\r\n```\r\n\r\n**What happened**:\r\n\r\nI created a bunch of objects with:\r\n```\r\nkubectl apply -f /objects/folder -l test=true\r\n```\r\nI then deleted one of the yaml files in /objects/folder and execute below:\r\n```\r\n$ kubectl apply -f /objects/folder -l test=true --prune\r\n...\r\npod \"jessie2\" pruned\r\n...\r\n```\r\nThe corresponding object is pruned as expected.\r\nI continue to delete all yaml files in /objects/folder and execute the same command again:\r\n```\r\n$ kubectl apply -f /objects/folder -l test=true --prune\r\nerror: no objects passed to apply\r\n```\r\n`kubectl apply --prune` is unable to remove the corresponding objects from the delete files.\r\n\r\n**What you expected to happen**:\r\n\r\n`kubectl apply --prune` would be able to remove the corresponding objects when all yaml files are deleted.\r\n\r\n**How to reproduce it**:\r\n\r\nPlease see \"What happened section\" above."},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/449420338","html_url":"https://github.com/kubernetes/kubernetes/issues/40635#issuecomment-449420338","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/40635","id":449420338,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTQyMDMzOA==","user":{"login":"iahmad-khan","id":13478264,"node_id":"MDQ6VXNlcjEzNDc4MjY0","avatar_url":"https://avatars0.githubusercontent.com/u/13478264?v=4","gravatar_id":"","url":"https://api.github.com/users/iahmad-khan","html_url":"https://github.com/iahmad-khan","followers_url":"https://api.github.com/users/iahmad-khan/followers","following_url":"https://api.github.com/users/iahmad-khan/following{/other_user}","gists_url":"https://api.github.com/users/iahmad-khan/gists{/gist_id}","starred_url":"https://api.github.com/users/iahmad-khan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iahmad-khan/subscriptions","organizations_url":"https://api.github.com/users/iahmad-khan/orgs","repos_url":"https://api.github.com/users/iahmad-khan/repos","events_url":"https://api.github.com/users/iahmad-khan/events{/privacy}","received_events_url":"https://api.github.com/users/iahmad-khan/received_events","type":"User","site_admin":false},"created_at":"2018-12-21T15:38:16Z","updated_at":"2018-12-21T15:38:16Z","author_association":"NONE","body":"Same issue , k8s version 1.12 , client 1.13\r\n\r\nthe resources matching the label are still there and prune doesnt work.\r\n"}}
{"actor":{"display_login":"iahmad-khan"}}