{"action":"created","issue":{"url":"https://api.github.com/repos/deis/deis/issues/4528","labels_url":"https://api.github.com/repos/deis/deis/issues/4528/labels{/name}","comments_url":"https://api.github.com/repos/deis/deis/issues/4528/comments","events_url":"https://api.github.com/repos/deis/deis/issues/4528/events","html_url":"https://github.com/deis/deis/issues/4528","id":107951673,"number":4528,"title":"provisioning should fail on a used discovery URL","user":{"login":"mboersma","id":73019,"avatar_url":"https://avatars.githubusercontent.com/u/73019?v=3","gravatar_id":"","url":"https://api.github.com/users/mboersma","html_url":"https://github.com/mboersma","followers_url":"https://api.github.com/users/mboersma/followers","following_url":"https://api.github.com/users/mboersma/following{/other_user}","gists_url":"https://api.github.com/users/mboersma/gists{/gist_id}","starred_url":"https://api.github.com/users/mboersma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mboersma/subscriptions","organizations_url":"https://api.github.com/users/mboersma/orgs","repos_url":"https://api.github.com/users/mboersma/repos","events_url":"https://api.github.com/users/mboersma/events{/privacy}","received_events_url":"https://api.github.com/users/mboersma/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/deis/deis/labels/contrib%20and%20provisioning","name":"contrib and provisioning","color":"009800"},{"url":"https://api.github.com/repos/deis/deis/labels/etcd/fleet","name":"etcd/fleet","color":"fef2c0"},{"url":"https://api.github.com/repos/deis/deis/labels/help%20wanted","name":"help wanted","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-23T15:57:00Z","updated_at":"2015-09-29T15:31:26Z","closed_at":null,"body":"A persistent problem is forgetting to run `make discovery-url` before provisioning a cluster. If it hasn't been run, and there's no user-data file, that is caught and handled well, but if a user-data exists with a discovery.etcd.io endpoint that's already been used, that isn't caught and provisioning will proceed and then fail with errors.\r\n\r\nPotentially Deis could either:\r\n- make an HTTP request of the discovery URL and fail if it exists, assuming that means it's been used already\r\n- mark the user-data file with some canonical entry that will be caught and handled as an error on reuse, and/or make it invalid YAML"},"comment":{"url":"https://api.github.com/repos/deis/deis/issues/comments/144095186","html_url":"https://github.com/deis/deis/issues/4528#issuecomment-144095186","issue_url":"https://api.github.com/repos/deis/deis/issues/4528","id":144095186,"user":{"login":"helgi","id":70530,"avatar_url":"https://avatars.githubusercontent.com/u/70530?v=3","gravatar_id":"","url":"https://api.github.com/users/helgi","html_url":"https://github.com/helgi","followers_url":"https://api.github.com/users/helgi/followers","following_url":"https://api.github.com/users/helgi/following{/other_user}","gists_url":"https://api.github.com/users/helgi/gists{/gist_id}","starred_url":"https://api.github.com/users/helgi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helgi/subscriptions","organizations_url":"https://api.github.com/users/helgi/orgs","repos_url":"https://api.github.com/users/helgi/repos","events_url":"https://api.github.com/users/helgi/events{/privacy}","received_events_url":"https://api.github.com/users/helgi/received_events","type":"User","site_admin":false},"created_at":"2015-09-29T15:31:26Z","updated_at":"2015-09-29T15:31:26Z","body":"What about just running `make discovery-url` on provision each time. That's what I have done.\r\n\r\nI did this in python, for ... reasons (import os and subprocess in one of the gen-cluster scripts)\r\n\r\n```python\r\ndef discovery_url():\r\n    # Ensure the cluster has the latest user-data\r\n    os.chdir(os.path.realpath(os.path.join(CURR_DIR, '..', '..', '..')))  # Just to get to the deis root\r\n    cmd = \"make discovery-url\"\r\n    _, err = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).communicate()\r\n    if err:\r\n        print err\r\n        raise\r\n    os.chdir(CURR_DIR)\r\n```\r\n\r\nIs there a problem with generating a new one on each provision since it is separate from updating? Seems simpler than jumping into HTTP parsing"}}