-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix validator #43
fix validator #43
Conversation
@@ -131,7 +131,7 @@ func HibernationOverrideResourceSchemaAttributes() map[string]resourceSchema.Att | |||
"is_hibernating": resourceSchema.BoolAttribute{ | |||
Optional: true, | |||
Validators: []validator.Bool{ | |||
boolvalidator.AlsoRequires(path.MatchRoot("override_until")), | |||
boolvalidator.AlsoRequires(path.MatchRelative().AtParent().AtName("override_until")), |
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.
do you mind explaining what these functions do and why it was broken before, sorry missing some context here
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.
at the parent of this param match an element by the provided name "override_until". Require that param if this param is provided.
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.
MatchRoot doesn't start at the parent but instead at the root of the object so "override_until" could not be found.
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.
only left one clarification question for my own understanding
Description
Fixes a bug in the validator used by the override spec
🎟 Issue(s)
🧪 Functional Testing
📸 Screenshots
📋 Checklist
examples/
directory