{"action":"created","issue":{"url":"https://api.github.com/repos/Tendrl/commons/issues/888","repository_url":"https://api.github.com/repos/Tendrl/commons","labels_url":"https://api.github.com/repos/Tendrl/commons/issues/888/labels{/name}","comments_url":"https://api.github.com/repos/Tendrl/commons/issues/888/comments","events_url":"https://api.github.com/repos/Tendrl/commons/issues/888/events","html_url":"https://github.com/Tendrl/commons/issues/888","id":309623244,"number":888,"title":"Use human readable name as cluster's integration_id","user":{"login":"shtripat","id":6771252,"avatar_url":"https://avatars0.githubusercontent.com/u/6771252?v=4","gravatar_id":"","url":"https://api.github.com/users/shtripat","html_url":"https://github.com/shtripat","followers_url":"https://api.github.com/users/shtripat/followers","following_url":"https://api.github.com/users/shtripat/following{/other_user}","gists_url":"https://api.github.com/users/shtripat/gists{/gist_id}","starred_url":"https://api.github.com/users/shtripat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shtripat/subscriptions","organizations_url":"https://api.github.com/users/shtripat/orgs","repos_url":"https://api.github.com/users/shtripat/repos","events_url":"https://api.github.com/users/shtripat/events{/privacy}","received_events_url":"https://api.github.com/users/shtripat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-03-29T05:20:27Z","updated_at":"2018-04-02T04:49:11Z","closed_at":null,"author_association":"MEMBER","body":"Currently in tendrl we use an UUID as cluster's integration_id and if multiple clusters maintained by tendrl it becomes tough to identify the clusters.\r\n\r\nThere is a suggestion to use human readable name as integration_id for clusters. So the flow to use a human readable name integration_id for cluster would be something like below\r\n\r\n1. While node agent detects a cluster which is ready for import, it creates a UUID as temporary detected integration_id for cluster and creates an object `/clusters/{detected-integration-id}` in etcd with `is_managed` value as `no`\r\n2. When UI triggers the import for this cluster the dialog thrown for import cluster would list this detected_cluster_id and user needs to provide a human readable integration_id value in the dialog. If user doesnt provide a human readable name in dialog the existing detected_integration_id remains as final integration_id for the cluster then onwards. May be UI should shown a warning on the dialog regarding the same saying `If no human readable name provided the detected_integration_id would remain as identifier for the cluster and later it wont be possible to change`.\r\n3. UI submits the import cluster request with a flag saying if the detected_cluster_id was replaced with human readable name and the new integration_id. API layer adds a check to find if a cluster with given new integration_id in request, already exists. If so API raises an error saying cluster with this name already exists. This check should happen only if UI send the flag `detected_integration_id_overriden` as `yes`\r\n4. In back-end the import cluster flow adds a pre check atom to do the check for pre-existence of cluster with new `integration_id` in parameters and fail if so. This pre check also runs only if `detected_integration_id_overriden` is set as `yes` in request.\r\n5. The import cluster flow replaces the object `/clusters/{detected_integration_id}` with `/clusters/{human_readable_integration_id}` in etcd based on `detected_integration_id_overriden` field set as `yes`. If the field `detected_integration_id_overriden` is not set as `yes` in request the old `/clusters/{detected_integartion_id}` remains as is.\r\n6. After this import flow runs as usual and continues.\r\n\r\nWith this there are no other changes required at back-end or any other components and it should be seamlessly working with human readable ntegration_id for cluster.\r\n\r\n@r0h4n @nthomas-redhat @gnehapk @shirshendu @GowthamShanmugam @cloudbehl comments/thoughts?\r\n\r\n@julienlim if we go ahead with this model, we would need UX changes for the import cluster dialog to capture the human readable integration_id for cluster.\r\n\r\nLets have all the discussion points captured here and go ahead based on the decision taken."},"comment":{"url":"https://api.github.com/repos/Tendrl/commons/issues/comments/377853914","html_url":"https://github.com/Tendrl/commons/issues/888#issuecomment-377853914","issue_url":"https://api.github.com/repos/Tendrl/commons/issues/888","id":377853914,"user":{"login":"shtripat","id":6771252,"avatar_url":"https://avatars0.githubusercontent.com/u/6771252?v=4","gravatar_id":"","url":"https://api.github.com/users/shtripat","html_url":"https://github.com/shtripat","followers_url":"https://api.github.com/users/shtripat/followers","following_url":"https://api.github.com/users/shtripat/following{/other_user}","gists_url":"https://api.github.com/users/shtripat/gists{/gist_id}","starred_url":"https://api.github.com/users/shtripat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shtripat/subscriptions","organizations_url":"https://api.github.com/users/shtripat/orgs","repos_url":"https://api.github.com/users/shtripat/repos","events_url":"https://api.github.com/users/shtripat/events{/privacy}","received_events_url":"https://api.github.com/users/shtripat/received_events","type":"User","site_admin":false},"created_at":"2018-04-02T04:49:11Z","updated_at":"2018-04-02T04:49:11Z","author_association":"MEMBER","body":"@r0h4n Just by setting `indexes/detected_cluster_id_to_integration_id/:detected_cluster_id` to `short_name` doesnt change the `NS.tendrl_context.integration` on nodes and so during configure monitoring colletcd gets old integration_id only. Also even if we delete `/clusters/{old integration id}` other nodes get that cluster entry back as detected cluster again. \r\n\r\nHow can we set the `NS.tendrl_context` with new integration_id (short_name) for all the nodes without restart of node-agent? I feel this will resolve most of the issue. I have seen GI started on the nodes also finds the old value of `NS.tendrl_context.integration`. Can you help on this front?"}}
{"actor":{"display_login":"shtripat"}}