{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/72519","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/72519/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/72519/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/72519/events","html_url":"https://github.com/kubernetes/kubernetes/issues/72519","id":395588742,"node_id":"MDU6SXNzdWUzOTU1ODg3NDI=","number":72519,"title":"ServiceAccountName not removed with Kubectl apply","user":{"login":"Joseph-Irving","id":15195889,"node_id":"MDQ6VXNlcjE1MTk1ODg5","avatar_url":"https://avatars3.githubusercontent.com/u/15195889?v=4","gravatar_id":"","url":"https://api.github.com/users/Joseph-Irving","html_url":"https://github.com/Joseph-Irving","followers_url":"https://api.github.com/users/Joseph-Irving/followers","following_url":"https://api.github.com/users/Joseph-Irving/following{/other_user}","gists_url":"https://api.github.com/users/Joseph-Irving/gists{/gist_id}","starred_url":"https://api.github.com/users/Joseph-Irving/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joseph-Irving/subscriptions","organizations_url":"https://api.github.com/users/Joseph-Irving/orgs","repos_url":"https://api.github.com/users/Joseph-Irving/repos","events_url":"https://api.github.com/users/Joseph-Irving/events{/privacy}","received_events_url":"https://api.github.com/users/Joseph-Irving/received_events","type":"User","site_admin":false},"labels":[{"id":105146071,"node_id":"MDU6TGFiZWwxMDUxNDYwNzE=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/kind/bug","name":"kind/bug","color":"e11d21","default":false},{"id":617149945,"node_id":"MDU6TGFiZWw2MTcxNDk5NDU=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/needs-sig","name":"needs-sig","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-01-03T14:18:50Z","updated_at":"2019-01-03T14:18:56Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!-->\r\n\r\n\r\n**What happened**:\r\nIf you have a deployment with `serviceAccountName` set if you remove the field and apply the new config the `serviceAccountName` remains set to what it previously was.\r\n**What you expected to happen**:\r\nThe `serviceAccountName` to be removed from the deployment spec.\r\n**How to reproduce it (as minimally and precisely as possible)**:\r\nApply a deployment with a service account set e.g\r\n```\r\n---\r\napiVersion: apps/v1\r\nkind: Deployment\r\nmetadata:\r\n  name: test\r\n  namespace: kube-system\r\nspec:\r\n  replicas: 2\r\n  selector:\r\n    matchLabels:\r\n      app: test\r\n  template:\r\n    metadata:\r\n      labels:\r\n        app: test\r\n    spec:\r\n      containers:\r\n        - name: test\r\n          image: busybox\r\n          command:\r\n            - sleep\r\n            - \"600\"\r\n    serviceAccountName: \"foo\"\r\n```\r\nThen apply the same manifest with it removed.\r\nkubectl apply -f test.yaml\r\n```\r\n---\r\napiVersion: apps/v1\r\nkind: Deployment\r\nmetadata:\r\n  name: test\r\n  namespace: kube-system\r\nspec:\r\n  replicas: 2\r\n  selector:\r\n    matchLabels:\r\n      app: test\r\n  template:\r\n    metadata:\r\n      labels:\r\n        app: test\r\n    spec:\r\n      containers:\r\n        - name: test\r\n          image: busybox\r\n          command:\r\n            - sleep\r\n            - \"600\"\r\n```\r\n\r\n`kubect get deploy test -o yaml`\r\n```\r\napiVersion: extensions/v1beta1\r\nkind: Deployment\r\nmetadata:\r\n  annotations:\r\n    deployment.kubernetes.io/revision: \"2\"\r\n    kubectl.kubernetes.io/last-applied-configuration: |\r\n      {\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"name\":\"test\",\"namespace\":\"kube-system\"},\"spec\":{\"replicas\":2,\"selector\":{\"matchLabels\":{\"app\":\"test\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"test\"}},\"spec\":{\"containers\":[{\"command\":[\"sleep\",\"600\"],\"image\":\"busybox\",\"name\":\"test\"}]}}}}\r\n  creationTimestamp: \"2019-01-03T14:10:52Z\"\r\n  generation: 5\r\n  name: test\r\n  namespace: kube-system\r\n  resourceVersion: \"214767939\"\r\n  selfLink: /apis/extensions/v1beta1/namespaces/kube-system/deployments/test\r\n  uid: 6131e4f9-0f61-11e9-85ae-025efa9cc9c4\r\nspec:\r\n  progressDeadlineSeconds: 600\r\n  replicas: 2\r\n  revisionHistoryLimit: 10\r\n  selector:\r\n    matchLabels:\r\n      app: test\r\n  strategy:\r\n    rollingUpdate:\r\n      maxSurge: 25%\r\n      maxUnavailable: 25%\r\n    type: RollingUpdate\r\n  template:\r\n    metadata:\r\n      creationTimestamp: null\r\n      labels:\r\n        app: test\r\n    spec:\r\n      containers:\r\n      - command:\r\n        - sleep\r\n        - \"600\"\r\n        image: busybox\r\n        imagePullPolicy: Always\r\n        name: test\r\n        resources: {}\r\n        terminationMessagePath: /dev/termination-log\r\n        terminationMessagePolicy: File\r\n      dnsPolicy: ClusterFirst\r\n      restartPolicy: Always\r\n      schedulerName: default-scheduler\r\n      securityContext: {}\r\n      serviceAccount: foo\r\n      serviceAccountName: foo\r\n      terminationGracePeriodSeconds: 30\r\n```\r\nThe service account is still set.\r\n\r\nI do get `deployment.apps/test configured` when applying the change which implies it notices the change but does not seem to act on it.\r\n**Anything else we need to know?**:\r\n\r\n**Environment**:\r\n- Kubernetes version (use `kubectl version`):\r\nv1.11.5 (have reproduced on minikube v1.13.0)\r\ncli: v1.13.1\r\n- Cloud provider or hardware configuration:\r\nAWS\r\n- OS (e.g. from /etc/os-release):\r\n```\r\nNAME=\"Container Linux by CoreOS\"\r\nID=coreos\r\nVERSION=1800.6.0\r\nVERSION_ID=1800.6.0\r\nBUILD_ID=2018-08-04-0323\r\nPRETTY_NAME=\"Container Linux by CoreOS 1800.6.0 (Rhyolite)\"\r\nANSI_COLOR=\"38;5;75\"\r\nHOME_URL=\"https://coreos.com/\"\r\nBUG_REPORT_URL=\"https://issues.coreos.com\"\r\nCOREOS_BOARD=\"amd64-usr\"\r\n```\r\n- Kernel (e.g. `uname -a`): \r\n```\r\nLinux ip-172-23-12-198.eu-west-1.compute.internal 4.14.59-coreos-r2 #1 SMP Sat Aug 4 02:49:25 UTC 2018 x86_64 Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz GenuineIntel GNU/Linux\r\n```\r\n- Install tools:\r\n- Others:\r\n\r\n<!-- DO NOT EDIT BELOW THIS LINE -->\r\n/kind bug"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/451155747","html_url":"https://github.com/kubernetes/kubernetes/issues/72519#issuecomment-451155747","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/72519","id":451155747,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTE1NTc0Nw==","user":{"login":"k8s-ci-robot","id":20407524,"node_id":"MDQ6VXNlcjIwNDA3NTI0","avatar_url":"https://avatars0.githubusercontent.com/u/20407524?v=4","gravatar_id":"","url":"https://api.github.com/users/k8s-ci-robot","html_url":"https://github.com/k8s-ci-robot","followers_url":"https://api.github.com/users/k8s-ci-robot/followers","following_url":"https://api.github.com/users/k8s-ci-robot/following{/other_user}","gists_url":"https://api.github.com/users/k8s-ci-robot/gists{/gist_id}","starred_url":"https://api.github.com/users/k8s-ci-robot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k8s-ci-robot/subscriptions","organizations_url":"https://api.github.com/users/k8s-ci-robot/orgs","repos_url":"https://api.github.com/users/k8s-ci-robot/repos","events_url":"https://api.github.com/users/k8s-ci-robot/events{/privacy}","received_events_url":"https://api.github.com/users/k8s-ci-robot/received_events","type":"User","site_admin":false},"created_at":"2019-01-03T14:18:56Z","updated_at":"2019-01-03T14:18:56Z","author_association":"CONTRIBUTOR","body":"@Joseph-Irving: There are no sig labels on this issue. Please add a sig label by either:\n\n1. mentioning a sig: `@kubernetes/sig-<group-name>-<group-suffix>`\n    e.g., `@kubernetes/sig-contributor-experience-<group-suffix>` to notify the contributor experience sig, OR\n\n2. specifying the label manually: `/sig <group-name>`\n    e.g., `/sig scalability` to apply the `sig/scalability` label\n\nNote: Method 1 will trigger an email to the group. See the [group list](https://git.k8s.io/community/sig-list.md).\nThe `<group-suffix>` in method 1 has to be replaced with one of these: _**bugs, feature-requests, pr-reviews, test-failures, proposals**_.\n\n\n<details>\n\nInstructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.\n</details>"}}
{"actor":{"display_login":"k8s-ci-robot"}}