-
Notifications
You must be signed in to change notification settings - Fork 25
Conversation
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.
LGTM with a couple minor comment nits
opc/data_source_machine_image.go
Outdated
} | ||
|
||
// Populate schema attributes | ||
d.SetId(fmt.Sprintf("%s", result.Name)) // TODO |
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.
Is there a TODO here or is this a leftover comment?
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.
Ah yes, I wasn't entirely sure what should be set for SetId()
- for the other data source I looked at for examples they are concatenating multiple attributes into the SetId() - for the machine image the name should be enough the be unique - but I did wonder if the Id should be set to the fully qualified name e.g. /Compute-mydomain/user@example.com/my-machine-image
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.
The name should be fine as an ID here. We had talked about doing fqdn for resources and I think this would be a good starting resource if you wanted to add that 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.
I've left it as just name, we should think though how we consistently handle the fully qualified resource names as apply across all resources in a single update, for another time...
opc/resource_machine_image.go
Outdated
Computed: true, | ||
}, | ||
|
||
// TODO |
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.
Can we put a little blurb about why this is TODO? Just so we know when to come back to it
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.
None of the machine images I checked returned a sizes response, so couldn't validate the data structure. I'll double check again and either update or remove.
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.
Fixed (removed)
opc/resource_machine_image.go
Outdated
if account, ok := d.GetOk("account"); ok && account != nil { | ||
input.Account = account.(string) | ||
} else { | ||
input.Account = fmt.Sprintf("/Compute-%s/cloud_storage", d.Get("identity_domain").(string)) // XXX TODO BROKEN |
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.
This needs to be removed
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.
Fixed
Fixed nits |
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.
LGTM!
Adds a resource and data source for the Machine Images API
https://docs.oracle.com/en/cloud/iaas/compute-iaas-cloud/stcsa/api-MachineImages.html