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

Improvement to create images using 'data_source_reference' #156

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

saratkumar-yb
Copy link
Contributor

  • Improvement to create images using 'data_source_reference'

@ghost ghost added the size/XS label Jul 6, 2020
@marinsalinas
Copy link
Contributor

@kumarsarath588 can you add a test case and website documentation for this feature?

@siddharth-nutanix
Copy link
Collaborator

siddharth-nutanix commented Feb 17, 2022

@kumarsarath588 Can you rebase your PR with master and change the type from map to list with max items as 1 as Maps doesn't support inner nested schema ?

Another option could be to use just TypeMap with
&schema.Schema { Type: schema.TypeString, }
Check https://www.terraform.io/plugin/sdkv2/schemas/schema-types#typemap for more details.

if iok && pok {
return diag.Errorf("both source_uri and source_path provided")
// if three path, uri, dsr are provided, return an error
if iok && pok && dsr {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if only two values are provided ?
Then also we should raise error.

Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Computed: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the field is marked as "Computed" then we should ideally read its value in resourceNutanixImageRead().
It calls out to https://www.nutanix.dev/api_references/prism-central-v3/#/b3A6MjU1ODc1MTE-get-a-existing-image API.
We can set this value in read function as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants