Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Conversation

@charlieegan3
Copy link
Contributor

@charlieegan3 charlieegan3 commented Jul 24, 2018

We had an issue (#377) where weneeded to plan the hub just to get the local files in place before running operations against other clusters.

This 'Prepares' the hub cluster before verifying it which puts the required files in place.

If the hub has not been applied, then trying to terraform another cluster in the env will still fail.

I've also added a comment explaining this function a little more as it's caused me some confusion in the past.

What this PR does / why we need it:
Fixes #377

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #377

Special notes for your reviewer:

Release note:

Prepare Hub clusters for output before terraforming other clusters in a multicluster environment. Fixes need to plan against hubs before applying.

We had an issue (#377) where we
needed to plan the hub just to get the local files in place before
running operations against other clusters.

This 'Prepares' the hub cluster before verifying it which puts the
required files in place.

If the hub has not been applied, then trying to terraform another
cluster in the env will still fail.

I've also added a comment explaining this function a little more as it's
caused me some confusion in the past.
@jetstack-bot jetstack-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 24, 2018
@jetstack-bot jetstack-bot requested a review from mattbates July 24, 2018 14:50
@charlieegan3
Copy link
Contributor Author

Provided for interest. This is the error you get if the hub has not been applied:

DEBU[0014] Terraform has been successfully initialized!  app=tarmak module=terraform std=out
ERRO[0017] The state file either has no outputs defined, or all the defined
outputs are empty. Please define an output in your configuration
with the `output` keyword and run `terraform refresh` for it to
become available. If you are using interpolation, please verify
the interpolated value is not empty. You can use the 
`terraform console` command to assist.
  app=tarmak module=terraform
FATA[0017] Tarmak exited with an error: failed to validate tarmak cluster: 1 error occurred:

* failed to get hub cluster output values, hub cluster must be applied once first: error getting terraform output: exit status 1  error="failed to validate tarmak cluster: 1 error occurred:\n\n* failed to get hub cluster output values, hub cluster must be applied once first: error getting terraform output: exit status 1"

It's not ideal but at the end it does say hub cluster must be applied once first

@charlieegan3
Copy link
Contributor Author

/assign @simonswine

@simonswine
Copy link
Contributor

/approve
/lgtm

@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 24, 2018
@jetstack-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: simonswine

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terraform state pull if hub output missing during multi-cluster apply

3 participants