-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fail HCP datasources for revoked iteration #11854
Conversation
@@ -96,7 +96,7 @@ require ( | |||
github.com/hashicorp/packer-plugin-vmware v1.0.7 | |||
github.com/hashicorp/packer-plugin-vsphere v1.0.5 | |||
github.com/hashicorp/packer-plugin-yandex v1.1.1 | |||
github.com/scaleway/packer-plugin-scaleway v1.0.5 | |||
github.com/scaleway/packer-plugin-scaleway v1.0.4 |
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.
Tag v1.0.5 doesn't exist anymore
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.
LGTM
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.
The changes look good to me. Is this behavior captured in the datasource docs?
Can you update #11849 with a changelog entry as well
No, but I should definitely update the documentation. Let me do that and update the changelog! |
internal/registry/service.go
Outdated
if !revokeAt.IsZero() && revokeAt.Before(time.Now().UTC()) { | ||
// If RevokeAt is not a zero date and is before NOW, it means this iteration is revoked and should not be used | ||
// to build new images. | ||
return nil, fmt.Errorf("the iteration %s is revoked and can not be used on Packer builds", | ||
resp.Payload.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.
I just realized that the error check for revoke_at is in the registry service code and not in the data source code itself. Is there any reason why you went that route as opposed to putting it in the data source?
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 was just reverting the first implementation and haven't thought too much about but I think it makes sense to put the check in the data source instead! So I updated the PR.
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'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
HCP Packer will stop replacing the image id/url with
error_revoked
so the hcp datasource will fail when querying revoked iterations. This reverts #11624