{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/71315","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/71315/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/71315/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/71315/events","html_url":"https://github.com/kubernetes/kubernetes/pull/71315","id":383072635,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyNjI3Mzk2","number":71315,"title":"kubeadm: config migrate handles more valid configs","user":{"login":"rosti","id":1117321,"node_id":"MDQ6VXNlcjExMTczMjE=","avatar_url":"https://avatars1.githubusercontent.com/u/1117321?v=4","gravatar_id":"","url":"https://api.github.com/users/rosti","html_url":"https://github.com/rosti","followers_url":"https://api.github.com/users/rosti/followers","following_url":"https://api.github.com/users/rosti/following{/other_user}","gists_url":"https://api.github.com/users/rosti/gists{/gist_id}","starred_url":"https://api.github.com/users/rosti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosti/subscriptions","organizations_url":"https://api.github.com/users/rosti/orgs","repos_url":"https://api.github.com/users/rosti/repos","events_url":"https://api.github.com/users/rosti/events{/privacy}","received_events_url":"https://api.github.com/users/rosti/received_events","type":"User","site_admin":false},"labels":[{"id":451459590,"node_id":"MDU6TGFiZWw0NTE0NTk1OTA=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/kubeadm","name":"area/kubeadm","color":"0052cc","default":false},{"id":477397086,"node_id":"MDU6TGFiZWw0NzczOTcwODY=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cncf-cla:%20yes","name":"cncf-cla: yes","color":"bfe5bf","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":114528068,"node_id":"MDU6TGFiZWwxMTQ1MjgwNjg=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/priority/critical-urgent","name":"priority/critical-urgent","color":"e11d21","default":false},{"id":349530249,"node_id":"MDU6TGFiZWwzNDk1MzAyNDk=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note-none","name":"release-note-none","color":"c2e0c6","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},{"id":253450978,"node_id":"MDU6TGFiZWwyNTM0NTA5Nzg=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/L","name":"size/L","color":"ee9900","default":false}],"state":"open","locked":false,"assignee":{"login":"fabriziopandini","id":5013060,"node_id":"MDQ6VXNlcjUwMTMwNjA=","avatar_url":"https://avatars0.githubusercontent.com/u/5013060?v=4","gravatar_id":"","url":"https://api.github.com/users/fabriziopandini","html_url":"https://github.com/fabriziopandini","followers_url":"https://api.github.com/users/fabriziopandini/followers","following_url":"https://api.github.com/users/fabriziopandini/following{/other_user}","gists_url":"https://api.github.com/users/fabriziopandini/gists{/gist_id}","starred_url":"https://api.github.com/users/fabriziopandini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabriziopandini/subscriptions","organizations_url":"https://api.github.com/users/fabriziopandini/orgs","repos_url":"https://api.github.com/users/fabriziopandini/repos","events_url":"https://api.github.com/users/fabriziopandini/events{/privacy}","received_events_url":"https://api.github.com/users/fabriziopandini/received_events","type":"User","site_admin":false},"assignees":[{"login":"timothysc","id":169553,"node_id":"MDQ6VXNlcjE2OTU1Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/169553?v=4","gravatar_id":"","url":"https://api.github.com/users/timothysc","html_url":"https://github.com/timothysc","followers_url":"https://api.github.com/users/timothysc/followers","following_url":"https://api.github.com/users/timothysc/following{/other_user}","gists_url":"https://api.github.com/users/timothysc/gists{/gist_id}","starred_url":"https://api.github.com/users/timothysc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timothysc/subscriptions","organizations_url":"https://api.github.com/users/timothysc/orgs","repos_url":"https://api.github.com/users/timothysc/repos","events_url":"https://api.github.com/users/timothysc/events{/privacy}","received_events_url":"https://api.github.com/users/timothysc/received_events","type":"User","site_admin":false},{"login":"fabriziopandini","id":5013060,"node_id":"MDQ6VXNlcjUwMTMwNjA=","avatar_url":"https://avatars0.githubusercontent.com/u/5013060?v=4","gravatar_id":"","url":"https://api.github.com/users/fabriziopandini","html_url":"https://github.com/fabriziopandini","followers_url":"https://api.github.com/users/fabriziopandini/followers","following_url":"https://api.github.com/users/fabriziopandini/following{/other_user}","gists_url":"https://api.github.com/users/fabriziopandini/gists{/gist_id}","starred_url":"https://api.github.com/users/fabriziopandini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabriziopandini/subscriptions","organizations_url":"https://api.github.com/users/fabriziopandini/orgs","repos_url":"https://api.github.com/users/fabriziopandini/repos","events_url":"https://api.github.com/users/fabriziopandini/events{/privacy}","received_events_url":"https://api.github.com/users/fabriziopandini/received_events","type":"User","site_admin":false},{"login":"luxas","id":5442475,"node_id":"MDQ6VXNlcjU0NDI0NzU=","avatar_url":"https://avatars1.githubusercontent.com/u/5442475?v=4","gravatar_id":"","url":"https://api.github.com/users/luxas","html_url":"https://github.com/luxas","followers_url":"https://api.github.com/users/luxas/followers","following_url":"https://api.github.com/users/luxas/following{/other_user}","gists_url":"https://api.github.com/users/luxas/gists{/gist_id}","starred_url":"https://api.github.com/users/luxas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luxas/subscriptions","organizations_url":"https://api.github.com/users/luxas/orgs","repos_url":"https://api.github.com/users/luxas/repos","events_url":"https://api.github.com/users/luxas/events{/privacy}","received_events_url":"https://api.github.com/users/luxas/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/kubernetes/kubernetes/milestones/40","html_url":"https://github.com/kubernetes/kubernetes/milestone/40","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones/40/labels","id":2913713,"node_id":"MDk6TWlsZXN0b25lMjkxMzcxMw==","number":40,"title":"v1.13","description":"","creator":{"login":"thockin","id":5595220,"node_id":"MDQ6VXNlcjU1OTUyMjA=","avatar_url":"https://avatars0.githubusercontent.com/u/5595220?v=4","gravatar_id":"","url":"https://api.github.com/users/thockin","html_url":"https://github.com/thockin","followers_url":"https://api.github.com/users/thockin/followers","following_url":"https://api.github.com/users/thockin/following{/other_user}","gists_url":"https://api.github.com/users/thockin/gists{/gist_id}","starred_url":"https://api.github.com/users/thockin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thockin/subscriptions","organizations_url":"https://api.github.com/users/thockin/orgs","repos_url":"https://api.github.com/users/thockin/repos","events_url":"https://api.github.com/users/thockin/events{/privacy}","received_events_url":"https://api.github.com/users/thockin/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":297,"state":"open","created_at":"2017-11-15T06:32:59Z","updated_at":"2018-11-21T16:18:49Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2018-11-21T11:21:29Z","updated_at":"2018-11-21T16:34:41Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/71315","html_url":"https://github.com/kubernetes/kubernetes/pull/71315","diff_url":"https://github.com/kubernetes/kubernetes/pull/71315.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/71315.patch"},"body":"<!--  Thanks for sending a pull request!  Here are some tips for you:\r\n1. If this is your first time, read our contributor guidelines https://git.k8s.io/community/contributors/guide#your-first-contribution and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide\r\n2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. For reference on required PR/issue labels, read here:\r\nhttps://git.k8s.io/community/contributors/devel/release.md#issue-kind-label\r\n3. Ensure you have added or ran the appropriate tests for your PR: https://git.k8s.io/community/contributors/devel/testing.md\r\n4. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews\r\n5. Follow the instructions for writing a release note: https://git.k8s.io/community/contributors/guide/release-notes.md\r\n6. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests\r\n-->\r\n\r\n**What type of PR is this?**\r\n/kind bug\r\n\r\n**What this PR does / why we need it**:\r\n\r\nkubeadm config migrate uses AnyConfigFileAndDefaultsToInternal, which can\r\nunmarshal config from file only if InitConfiguration or JoinConfiguration are\r\npresent. Even with that in mind, it can only return a singlie config object,\r\nwith InitConfiguration taking precendence over JoinConfiguration. Thus, the\r\nfollowing cases were not handled properly, while they were perfectly valid for\r\nkubeadm init/join:\r\n\r\n- ClusterConfiguration only file caused kubeadm config migrate to exit with\r\n  error.\r\n- Init + Join configurations in the same file caused Init + Cluster\r\n  configuration to be produced (ignoring JoinConfiguration). The same is valid\r\n  when the combo is Init + Cluster + Join configurations.\r\n- Cluster + Join configuration ignores ClusterConfiguration and only\r\n  JoinConfiguration gets migrated.\r\n\r\nTo fix this, the following is done:\r\n- Introduce MigrateOldConfigFromFile which migrates old config from a file,\r\n  while ensuring that all kubeadm originated input config kinds are taken care\r\n  of. Add comprehensive unit tests for this.\r\n- Replace the use of AnyConfigFileAndDefaultsToInternal in\r\n  kubeadm config migrate with MigrateOldConfigFromFile.\r\n- Remove the no longer used and error prone AnyConfigFileAndDefaultsToInternal.\r\n\r\n**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:\r\nFixes kubernetes/kubeadm#1262\r\n\r\n**Special notes for your reviewer**:\r\n\r\n/cc @kubernetes/sig-cluster-lifecycle-pr-reviews\r\n/area kubeadm\r\n/assign @fabriziopandini\r\n/assign @timothysc\r\n/assign @luxas \r\n\r\n**Does this PR introduce a user-facing change?**:\r\n<!--  \r\nIf no, just write \"NONE\".\r\nIf yes, a release note is required:\r\nEnter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string \"action required\".\r\n2. \r\n-->\r\n```release-note\r\nNONE\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/440730155","html_url":"https://github.com/kubernetes/kubernetes/pull/71315#issuecomment-440730155","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/71315","id":440730155,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDczMDE1NQ==","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":"2018-11-21T16:34:41Z","updated_at":"2018-11-21T16:34:41Z","author_association":"CONTRIBUTOR","body":"[APPROVALNOTIFIER] This PR is **APPROVED**\n\nThis pull-request has been approved by: *<a href=\"https://github.com/kubernetes/kubernetes/pull/71315#pullrequestreview-177329589\" title=\"Approved\">fabriziopandini</a>*, *<a href=\"https://github.com/kubernetes/kubernetes/pull/71315#\" title=\"Author self-approved\">rosti</a>*\n\nThe full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands).\n\nThe pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)\n\n<details >\nNeeds approval from an approver in each of these files:\n\n- ~~[cmd/kubeadm/OWNERS](https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/OWNERS)~~ [fabriziopandini]\n\nApprovers can indicate their approval by writing `/approve` in a comment\nApprovers can cancel approval by writing `/approve cancel` in a comment\n</details>\n<!-- META={\"approvers\":[]} -->"}}
{"actor":{"display_login":"k8s-ci-robot"}}