Skip to content
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

plantimestamp can be unknown during validation #35902

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Oct 25, 2024

Before a timestamp is assigned during plan, the time.Time value will be the zero value for that type. This represents a case where the timestamp is not yet known, but the handling of that timestamp isn't using our usual cty value system for representing unknowns. Rather than refactor the use of the timestamp itself throughout the code, we can simply have the function return an unknown if it encounters a zero value.

Fixes #35898

Before a timestamp is assigned during plan, the `time.Time` value will
be the zero value for that type. This represents a case where the
timestamp is not yet known, but the handling of that timestamp isn't
using our usual cty value system for representing unknowns. Rather than
refactor the use of the timestamp itself throughout the code, we can
simply have the function return an unknown if it encounters a zero
value.
@jbardin jbardin requested a review from a team October 25, 2024 13:47
@jbardin jbardin merged commit 2a7ddd9 into main Oct 25, 2024
6 checks passed
@jbardin jbardin deleted the jbardin/plantimestamp-validate branch October 25, 2024 14:31
Copy link
Contributor

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

Copy link
Contributor

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 contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plantimestamp() function producing invalid value (0001-01-01T00:00:00Z)
2 participants