{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60970","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60970/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60970/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60970/events","html_url":"https://github.com/kubernetes/kubernetes/issues/60970","id":303767339,"node_id":"MDU6SXNzdWUzMDM3NjczMzk=","number":60970,"title":"Fail to apply service objects after running `cluster/update-storage-objects.sh`","user":{"login":"superbrothers","id":230185,"node_id":"MDQ6VXNlcjIzMDE4NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/230185?v=4","gravatar_id":"","url":"https://api.github.com/users/superbrothers","html_url":"https://github.com/superbrothers","followers_url":"https://api.github.com/users/superbrothers/followers","following_url":"https://api.github.com/users/superbrothers/following{/other_user}","gists_url":"https://api.github.com/users/superbrothers/gists{/gist_id}","starred_url":"https://api.github.com/users/superbrothers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superbrothers/subscriptions","organizations_url":"https://api.github.com/users/superbrothers/orgs","repos_url":"https://api.github.com/users/superbrothers/repos","events_url":"https://api.github.com/users/superbrothers/events{/privacy}","received_events_url":"https://api.github.com/users/superbrothers/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":778118402,"node_id":"MDU6TGFiZWw3NzgxMTg0MDI=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/lifecycle/rotten","name":"lifecycle/rotten","color":"604460","default":false},{"id":173494222,"node_id":"MDU6TGFiZWwxNzM0OTQyMjI=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/cluster-lifecycle","name":"sig/cluster-lifecycle","color":"d2b48c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-03-09T08:54:09Z","updated_at":"2018-08-12T00:42:22Z","closed_at":null,"author_association":"MEMBER","body":"<!-- This form is for bug reports and feature requests ONLY! \r\n\r\nIf you're looking for help check [Stack Overflow](https://stackoverflow.com/questions/tagged/kubernetes) and the [troubleshooting guide](https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/).\r\n-->\r\n\r\n**Is this a BUG REPORT or FEATURE REQUEST?**:\r\n\r\n> Uncomment only one, leave it on its own line: \r\n>\r\n/kind bug\r\n> /kind feature\r\n\r\n\r\n**What happened**:\r\nI ran `cluster/update-storage-objects.sh`, then I tried to apply a service object by `kubectl apply`. However it failed along with the following message:\r\n```\r\n$ kubectl apply -f svc.yaml\r\nThe Service \"nginx\" is invalid:\r\n* metadata.resourceVersion: Invalid value: \"\": must be specified for an update\r\n* spec.clusterIP: Invalid value: \"\": field is immutable\r\n```\r\n\r\nThe cause of this problem is since `kubectl.kubernetes.io/last-applied-configuration` annotation is updated by `kubectl replace` in `cluster/update-storage-objects.sh`.\r\n\r\n**What you expected to happen**: It succeeds to apply service objects and more by `kubectl apply` after running `cluster-update-storage-objects.sh`.\r\n\r\n**How to reproduce it (as minimally and precisely as possible)**:\r\n```\r\n$ minikube start --kubernetes-version v1.9.0\r\n$ git clone -b release-1.9 --depth 1 https://github.com/kubernetes/kubernetes.git $GOPATH/src/k8s.io/kubernetes && cd $GOPATH/src/k8s.io/kubernetes/\r\n$ git log --pretty=\"%H\"\r\n326c7c181909a806f05227724ca604c3d2b672e9\r\n# This is a workaround for #59403, #60741\r\n$ curl --silent -L https://gist.githubusercontent.com/superbrothers/97c54019171231ab6d99c6f610f85e05/raw/a1362609f1193096587f81446dc0edc0cea49b04/gistfile1.txt | patch -p1\r\npatching file cluster/update-storage-objects.sh\r\n$ git diff\r\ndiff --git a/cluster/update-storage-objects.sh b/cluster/update-storage-objects.sh\r\nindex 364c1d7e..a451a2d0 100755\r\n--- a/cluster/update-storage-objects.sh\r\n+++ b/cluster/update-storage-objects.sh\r\n@@ -34,7 +34,6 @@ KUBECTL=\"${KUBE_OUTPUT_HOSTBIN}/kubectl\"\r\n # TODO: Get this list of resources from server once\r\n # http://issue.k8s.io/2057 is fixed.\r\n declare -a resources=(\r\n-    \"endpoints\"\r\n     \"events\"\r\n     \"limitranges\"\r\n     \"namespaces\"\r\n@@ -50,9 +49,7 @@ declare -a resources=(\r\n     \"horizontalpodautoscalers\"\r\n     \"storageclasses\"\r\n     \"roles.rbac.authorization.k8s.io\"\r\n-    \"rolebindings.rbac.authorization.k8s.io\"\r\n     \"clusterroles.rbac.authorization.k8s.io\"\r\n-    \"clusterrolebindings.rbac.authorization.k8s.io\"\r\n     \"networkpolicies.networking.k8s.io\"\r\n )\r\n\r\n$ make kubectl\r\n$ _output/bin/kubectl version\r\nClient Version: version.Info{Major:\"\", Minor:\"\", GitVersion:\"v0.0.0-master+$Format:%h$\", GitCommit:\"326c7c181909a806f05227724ca604c3d2b672e9\", GitTreeState:\"dirty\", BuildDate:\"2018-03-09T08:30:25Z\", GoVersion:\"go1.9.2\", Compiler:\"gc\", Platform:\"darwin/amd64\"}\r\nServer Version: version.Info{Major:\"\", Minor:\"\", GitVersion:\"v1.9.0\", GitCommit:\"925c127ec6b946659ad0fd596fa959be43f0cc05\", GitTreeState:\"clean\", BuildDate:\"2018-01-26T19:04:38Z\", GoVersion:\"go1.9.1\", Compiler:\"gc\", Platform:\"linux/amd64\"}\r\n$ cat <<EOL > svc.yaml\r\napiVersion: v1\r\nkind: Service\r\nmetadata:\r\n  name: nginx\r\nspec:\r\n  ports:\r\n  - port: 80\r\n    protocol: TCP\r\n    targetPort: 80\r\n  selector:\r\n    run: nginx\r\nEOL\r\n$ kubectl apply -f svc.yaml\r\n$ kubectl get svc nginx -o 'jsonpath={.metadata.annotations.kubectl\\.kubernetes\\.io/last-applied-configuration}'\r\n{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"name\":\"nginx\",\"namespace\":\"default\"},\"spec\":{\"ports\":[{\"port\":80,\"protocol\":\"TCP\",\"targetPort\":80}],\"selector\":{\"run\":\"nginx\"}}}\r\n$ cluster/update-storage-objects.sh\r\nAll objects updated successfully!!\r\n# last-applied-configuration was updated by `kubectl replace` in `cluster/update-storage-objects.sh`\r\n$ kubectl get svc nginx -o 'jsonpath={.metadata.annotations.kubectl\\.kubernetes\\.io/last-applied-configuration}'\r\n{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"creationTimestamp\":\"2018-03-09T08:33:28Z\",\"name\":\"nginx\",\"namespace\":\"default\",\"resourceVersion\":\"1100\",\"selfLink\":\"/api/v1/namespaces/default/services/nginx\",\"uid\":\"8ad8402b-2374-11e8-abfd-080027cf7ad3\"},\"spec\":{\"clusterIP\":\"10.108.65.152\",\"ports\":[{\"port\":80,\"protocol\":\"TCP\",\"targetPort\":80}],\"selector\":{\"run\":\"nginx\"},\"sessionAffinity\":\"None\",\"type\":\"ClusterIP\"},\"status\":{\"loadBalancer\":{}}}\r\n$ kubectl apply -f svc.yaml\r\nThe Service \"nginx\" is invalid:\r\n* metadata.resourceVersion: Invalid value: \"\": must be specified for an update\r\n* spec.clusterIP: Invalid value: \"\": field is immutable\r\n```\r\n\r\n**Anything else we need to know?**:\r\n\r\n**Environment**:\r\n- Kubernetes version (use `kubectl version`):\r\n    - Client Version: version.Info{Major:\"\", Minor:\"\", GitVersion:\"v0.0.0-master+$Format:%h$\", GitCommit:\"326c7c181909a806f05227724ca604c3d2b672e9\", GitTreeState:\"dirty\", BuildDate:\"2018-03-09T08:30:25Z\", GoVersion:\"go1.9.2\", Compiler:\"gc\", Platform:\"darwin/amd64\"}\r\n    - Server Version: version.Info{Major:\"\", Minor:\"\", GitVersion:\"v1.9.0\", GitCommit:\"925c127ec6b946659ad0fd596fa959be43f0cc05\", GitTreeState:\"clean\", BuildDate:\"2018-01-26T19:04:38Z\", GoVersion:\"go1.9.1\", Compiler:\"gc\", Platform:\"linux/amd64\"}\r\n- Cloud provider or hardware configuration:\r\n- OS (e.g. from /etc/os-release): OS X 10.11.6 (15G19009)\r\n- Kernel (e.g. `uname -a`): Darwin Z-MAC-A-001.local 15.6.0 Darwin Kernel Version 15.6.0: Tue Jan  9 20:12:05 PST 2018; root:xnu-3248.73.5~1/RELEASE_X86_64 x86_64 i386 iMac17,1 Darwin\r\n- Install tools: minikube\r\n- Others:"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/412310672","html_url":"https://github.com/kubernetes/kubernetes/issues/60970#issuecomment-412310672","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60970","id":412310672,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjMxMDY3Mg==","user":{"login":"fejta-bot","id":30488982,"node_id":"MDQ6VXNlcjMwNDg4OTgy","avatar_url":"https://avatars1.githubusercontent.com/u/30488982?v=4","gravatar_id":"","url":"https://api.github.com/users/fejta-bot","html_url":"https://github.com/fejta-bot","followers_url":"https://api.github.com/users/fejta-bot/followers","following_url":"https://api.github.com/users/fejta-bot/following{/other_user}","gists_url":"https://api.github.com/users/fejta-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/fejta-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fejta-bot/subscriptions","organizations_url":"https://api.github.com/users/fejta-bot/orgs","repos_url":"https://api.github.com/users/fejta-bot/repos","events_url":"https://api.github.com/users/fejta-bot/events{/privacy}","received_events_url":"https://api.github.com/users/fejta-bot/received_events","type":"User","site_admin":false},"created_at":"2018-08-12T00:42:22Z","updated_at":"2018-08-12T00:42:22Z","author_association":"NONE","body":"Rotten issues close after 30d of inactivity.\nReopen the issue with `/reopen`.\nMark the issue as fresh with `/remove-lifecycle rotten`.\n\nSend feedback to sig-testing, kubernetes/test-infra and/or [fejta](https://github.com/fejta).\n/close"}}
{"actor":{"display_login":"fejta-bot"}}