-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement Vault update (public_endpoint only) #152
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly just nits; actual update code looks good!
DeleteContext: resourceVaultClusterDelete, | ||
Timeouts: &schema.ResourceTimeout{ | ||
Create: &createVaultClusterTimeout, | ||
Create: &createUpdateVaultClusterTimeout, | ||
Update: &createUpdateTimeoutDuration, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be &createUpdateVaultClusterTimeout
instead of using Consul's value?
Update: &createUpdateTimeoutDuration, | |
Update: &createUpdateVaultClusterTimeout, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah woops, good spot! Think I'm gonna rename the Consul values to be more specific too
@@ -22,7 +22,7 @@ var defaultVaultClusterTimeout = time.Minute * 5 | |||
|
|||
// createTimeout is the amount of time that can elapse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit
// createTimeout is the amount of time that can elapse | |
// createUpdateVaultClusterTimeout is the amount of time that can elapse |
resource "hcp_vault_cluster" "test" { | ||
cluster_id = "test-vault-cluster" | ||
hvn_id = hcp_hvn.test.hvn_id | ||
tier = "dev" | ||
tier = "dev" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nit: looks like a mix of tabs and spaces here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna make note of this in our test writing readme.
resource "hcp_vault_cluster" "test" { | ||
cluster_id = "test-vault-cluster" | ||
hvn_id = hcp_hvn.test.hvn_id | ||
tier = "dev" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nit: looks like a mix of tabs and spaces here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops that just needed a rebase
internal/clients/vault_cluster.go
Outdated
@@ -85,3 +85,28 @@ func CreateVaultClusterAdminToken(ctx context.Context, client *Client, loc *shar | |||
|
|||
return resp.Payload, nil | |||
} | |||
|
|||
// UpdateVaultCluster will make a call to the Vault service to enable or disable public IPs for the Vault cluster. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit
// UpdateVaultCluster will make a call to the Vault service to enable or disable public IPs for the Vault cluster. | |
// UpdateVaultClusterPublicIps will make a call to the Vault service to enable or disable public IPs for the Vault cluster. |
currently only 'public_endpoint' can be updated
vault cluster
to make it more clear which cluster we're talking about :)
🛠️ Description
Jumping off @bplotnick's contribution #118, I've implemented the Vault cluster resource Update function to enable updating
public_endpoint
without forcing the recreation of the cluster.🏗️ Acceptance tests
Output from acceptance testing: