-
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 revoke_at to HCP Packer datasources output #330
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.
Code looks good. I'm just curious why the value needs to be set on the provider side and not the backend.
@@ -175,6 +181,11 @@ func dataSourcePackerImageIterationRead(ctx context.Context, d *schema.ResourceD | |||
if err := d.Set("created_at", iteration.CreatedAt.String()); err != nil { | |||
return diag.FromErr(err) | |||
} | |||
if !time.Time(iteration.RevokeAt).IsZero() { |
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.
Is this value only tracked in the datasource? Generally I would expect it to read from the API response
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.
iteration.RevokeAt
is a value returned in API response. In this PR I'm making it available in the data source output. I do the zero check here, before writing it in the output, because the default value for strfmt.DateTime{} is 0001-01-01T00:00:00.000Z
, so to avoid writing the zero value in the output.
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.
Ooh I misread this haha :doh:
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 changes look good to me. One suggestion but otherwise looks good to go.
🛠️ Description
HCP Packer will no longer return
error_revoked
so we are adding therevoke_at
timestamp to all of our datasources.🚢 Release Note
🏗️ Acceptance tests
Output from acceptance testing: