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

Fix: env0_agent_values data source doesn't fetch values #694

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

TomerHeber
Copy link
Collaborator

Issue & Steps to Reproduce / Feature Request

fixes #690

Solution

resty does not play nice with non-struct values.
had to manually handle the string pointer use-case.


return client.httpResult(result, err)
} else {
return client.httpResult(request.SetResult(response).Get(path))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

normal use-case (regular code) - uses built-in SetResult.

responseType := reflect.TypeOf(response)

if responseType.Kind() == reflect.Ptr && responseType.Elem().Kind() == reflect.String {
responseStrPtr := response.(*string)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

handles the string pointer use-case.

@github-actions github-actions bot added ready to merge PR approved - can be merged once the PR owner is ready and removed pending final review labels Aug 16, 2023
@TomerHeber TomerHeber merged commit 86031f3 into main Aug 16, 2023
12 checks passed
@TomerHeber TomerHeber deleted the fix-agent-values-#690 branch August 16, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-client fix ready to merge PR approved - can be merged once the PR owner is ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

env0_agent_values data source doesn't fetch values
2 participants