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

Validate rule sequence numbers on create only #1001

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

annakhm
Copy link
Collaborator

@annakhm annakhm commented Oct 16, 2023

Since sequence number is Computed in rule, bad sequence numbers may be stuck in state as a result of configurations with previous provider version.
Rather than throwing an error, the provider will auto-correct the sequence number while also logging this event.
For create flow, we leave sequence number validation since state for new object is clean.

@annakhm
Copy link
Collaborator Author

annakhm commented Oct 16, 2023

/test-all

@annakhm annakhm requested review from ksamoray and wsquan171 October 17, 2023 16:57
@annakhm annakhm assigned GraysonWu and unassigned GraysonWu Oct 18, 2023
@annakhm annakhm requested a review from GraysonWu October 18, 2023 18:26
Copy link
Contributor

@wsquan171 wsquan171 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit otherwise lgtm

Comment on lines 91 to 93
err := validatePolicyRuleSequence(d)
if err != nil {
return err
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: for simplicity

if err := validatePolicyRuleSequence(d); err != nil {
   return err
}

Since sequence number is Computed in rule, bad sequence numbers
may be stuck in state as a result of configurations with previous
provider version.
Rather than throwing an error, the provider will auto-correct the
sequence number while also logging this event.
For create flow, we leave sequence number validation since state
for new object is clean.

Signed-off-by: Anna Khmelnitsky <[email protected]>
@annakhm annakhm force-pushed the fix-sequence-number-validation branch from 8de90fa to eab9f72 Compare October 19, 2023 16:10
@annakhm
Copy link
Collaborator Author

annakhm commented Oct 19, 2023

/test-all

@annakhm annakhm merged commit 9f08061 into master Oct 23, 2023
2 checks passed
@annakhm annakhm deleted the fix-sequence-number-validation branch February 5, 2024 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants