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

[bugfix] Provider created content_library_vm_template successfully but produced an unexpected new value. #20

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

Conversation

Xiritianming
Copy link

Files Changed

  • Update internal/provider/resource_content_library_vm_template.go.

Relations

Closes: #18

@Xiritianming Xiritianming marked this pull request as ready for review September 5, 2024 03:40
@Sczlog
Copy link
Collaborator

Sczlog commented Nov 11, 2024

I think the change should be use id of content library template to query vm template, not to query content library vm template then query vm template, which make fewer line changed and less query make
for example change

	gvtp.RequestBody = &models.GetVMTemplatesRequestBody{
		Where: &models.VMTemplateWhereInput{
			ID: &id,
		},
	}

to

	gvtp.RequestBody = &models.GetVMTemplatesRequestBody{
		Where: &models.VMTemplateWhereInput{
			ContentLibraryVMTemplate: &models.ContentLibraryVMTemplateWhereInput{
				ID: &id,
			},
		},
	}

also can add an extra First:1 or combined cluster where clause to query only one template, all template under same content library template should have common meta data

…ate successfully but produced an unexpected new value.
@Xiritianming Xiritianming force-pushed the bugfix-resource_content_library_vm_template branch from 857f8ea to b8c9249 Compare November 19, 2024 07:01
@Xiritianming
Copy link
Author

I think the change should be use id of content library template to query vm template, not to query content library vm template then query vm template, which make fewer line changed and less query make for example change

	gvtp.RequestBody = &models.GetVMTemplatesRequestBody{
		Where: &models.VMTemplateWhereInput{
			ID: &id,
		},
	}

to

	gvtp.RequestBody = &models.GetVMTemplatesRequestBody{
		Where: &models.VMTemplateWhereInput{
			ContentLibraryVMTemplate: &models.ContentLibraryVMTemplateWhereInput{
				ID: &id,
			},
		},
	}

also can add an extra First:1 or combined cluster where clause to query only one template, all template under same content library template should have common meta data

Nice advice. I committed new code based on your advice, and it works with the #18 example.

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.

Provider created content_library_vm_template successfully but produced an unexpected new value.
2 participants