-
Notifications
You must be signed in to change notification settings - Fork 431
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
feat: Task resource v1 readiness part 2 #3170
Changes from 22 commits
38b8550
6837bc5
c2f707d
6843e03
12eadb0
28bf6a5
62adccb
bba9569
80ca12e
f0514bc
ee9583d
90404b9
012fb18
90d7046
e491545
8330951
62edcec
a90fb21
b73d55a
a200cfe
ae9c5c3
209b04e
4e00882
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,17 @@ func attributeDirectValueCreate[T any](d *schema.ResourceData, key string, creat | |
return nil | ||
} | ||
|
||
func attributeMappedValueCreate[T any](d *schema.ResourceData, key string, createField **T, mapper func(value any) (*T, error)) error { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: we can call this in other functions above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed them, but it seemed to complicate the code (it's easier to understand the above functions the way they are right now). I would leave them as they are right now. |
||
if v, ok := d.GetOk(key); ok { | ||
value, err := mapper(v) | ||
if err != nil { | ||
return err | ||
} | ||
*createField = value | ||
} | ||
return nil | ||
} | ||
|
||
func copyGrantsAttributeCreate(d *schema.ResourceData, isOrReplace bool, orReplaceField, copyGrantsField **bool) error { | ||
if isOrReplace { | ||
*orReplaceField = sdk.Bool(true) | ||
|
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.
nit (maybe for next PRs): instructions for user what they need to do and what will be handled automatically
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.
Yeah, probably next pr, because there's no state upgrader yet
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.
Also, a typo:
schedule