{"action":"opened","issue":{"url":"https://api.github.com/repos/jetstack/tarmak/issues/377","repository_url":"https://api.github.com/repos/jetstack/tarmak","labels_url":"https://api.github.com/repos/jetstack/tarmak/issues/377/labels{/name}","comments_url":"https://api.github.com/repos/jetstack/tarmak/issues/377/comments","events_url":"https://api.github.com/repos/jetstack/tarmak/issues/377/events","html_url":"https://github.com/jetstack/tarmak/issues/377","id":344054836,"node_id":"MDU6SXNzdWUzNDQwNTQ4MzY=","number":377,"title":"Terraform state pull if hub output missing during multi-cluster apply","user":{"login":"charlieegan3","id":1774239,"node_id":"MDQ6VXNlcjE3NzQyMzk=","avatar_url":"https://avatars3.githubusercontent.com/u/1774239?v=4","gravatar_id":"","url":"https://api.github.com/users/charlieegan3","html_url":"https://github.com/charlieegan3","followers_url":"https://api.github.com/users/charlieegan3/followers","following_url":"https://api.github.com/users/charlieegan3/following{/other_user}","gists_url":"https://api.github.com/users/charlieegan3/gists{/gist_id}","starred_url":"https://api.github.com/users/charlieegan3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlieegan3/subscriptions","organizations_url":"https://api.github.com/users/charlieegan3/orgs","repos_url":"https://api.github.com/users/charlieegan3/repos","events_url":"https://api.github.com/users/charlieegan3/events{/privacy}","received_events_url":"https://api.github.com/users/charlieegan3/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-24T14:10:06Z","updated_at":"2018-07-24T14:10:06Z","closed_at":null,"author_association":"MEMBER","body":"**Is this a BUG REPORT or FEATURE REQUEST?**:\r\n\r\n/kind bug\r\n\r\n**What happened**:\r\nFrom a clean tarmak config directory in a multi cluster env. Applying a non-hub cluster will result in an error about missing hub output.\r\n\r\nPlanning the hub will ensure it's there but this is undesirable.\r\n\r\n**What you expected to happen**:\r\nI expect tarmak to fetch the hub state if it's missing, and fail in this way only if the hub doesn't exist yet.\r\n\r\nWe don't want to auto apply the hub since it's slower and we need to have the secrets saved locally on the first apply of the hub.\r\n\r\n**How to reproduce it (as minimally and precisely as possible)**:\r\nSee 'what happened'\r\n\r\n**Anything else we need to know?**:\r\nPlanned fix:\r\n\r\nIn verifyHubState, fetch the state if it's missing. Somewhere in here:\r\n\r\n```\r\nfunc (c *Cluster) verifyHubState() error {\r\n\terrMsg := \"ensure hub cluster has been fully applied\"\r\n\toutput, err := c.Environment().Tarmak().Terraform().Output(c.Environment().Hub())\r\n\tif err != nil {\r\n\t\treturn fmt.Errorf(\"failed to retrieve hub cluster output, %s: %v\", errMsg, err)\r\n\t}\r\n...\r\n```\r\n\r\nThis function is only ran for multi clusters anyway.\r\n"}}
{"actor":{"display_login":"charlieegan3"}}