Skip to content

plantimestamp can be unknown during validation#35902

Merged
jbardin merged 1 commit intomainfrom
jbardin/plantimestamp-validate
Oct 25, 2024
Merged

plantimestamp can be unknown during validation#35902
jbardin merged 1 commit intomainfrom
jbardin/plantimestamp-validate

Conversation

@jbardin
Copy link
Copy Markdown
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
@jbardin jbardin deleted the jbardin/plantimestamp-validate branch October 25, 2024 14:31
@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
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