-
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
Add check for revoked iterations to HCP Packer datasources #240
Conversation
The Vault-related changes look great. Thanks Moss! |
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.
Had a couple questions!
go.mod
Outdated
@@ -11,7 +11,7 @@ require ( | |||
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 | |||
github.com/hashicorp/go-version v1.3.0 | |||
github.com/hashicorp/hcl/v2 v2.8.2 // indirect | |||
github.com/hashicorp/hcp-sdk-go v0.14.0 | |||
github.com/hashicorp/hcp-sdk-go v0.15.1-0.20220112153249-f565607d7cc4 |
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.
I need to get some network updates into the go SDK, so I'll try to release 0.16.0 with your changes tomorrow.
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.
Got it! So I'll wait for the release to update this one with 0.16.0
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.
if !time.Time(iteration.RevokeAt).IsZero() { | ||
// If RevokeAt is not a zero date, it means this iteration is revoked and should not be used | ||
// to build new images. | ||
return diag.Errorf("the iteration %s is revoked and can not be used", iteration.ID) |
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.
Can we advise the user what to do/change when they run into this error?
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.
I think we can, I will try to think of a better text!
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.
Done! I also improved some of the tests
@@ -17,8 +17,8 @@ import ( | |||
cloud_consul "github.com/hashicorp/hcp-sdk-go/clients/cloud-consul-service/preview/2021-02-04/client" | |||
"github.com/hashicorp/hcp-sdk-go/clients/cloud-consul-service/preview/2021-02-04/client/consul_service" | |||
|
|||
cloud_vault "github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-service/preview/2020-11-25/client" | |||
"github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-service/preview/2020-11-25/client/vault_service" | |||
cloud_vault "github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-service/stable/2020-11-25/client" |
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.
thanks for taking care of this!
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.
This looks good to me. Nicely done; especially with the added tests.
37c6965
to
019d747
Compare
019d747
to
2e11ddd
Compare
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.
Once you get the Go SDK v0.16.0 in, this is good to go!
🛠️ Description
This adds a check for revoked iterations. For HCP Packer GA, revoking iterations will be possible and if an iteration is revoked it must never be used and the
terraform plan|apply
should fail.Since I updated the hcp-sdk-go version, I had to make some changes to vault's import and tests. Changes were checked and validated with @kkredit
🚢 Release Note
Release note for CHANGELOG:
🏗️ Acceptance tests
Output from acceptance testing: