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

SCALRCORE-24000 Provider > panic: interface conversion: interface {} is nil, not string #191

Merged
merged 3 commits into from
Nov 14, 2022

Conversation

petroprotsakh
Copy link
Member

@petroprotsakh petroprotsakh commented Nov 8, 2022

Changelog

Documentation

  • I have updated resource/data source documentation in docs

State

  • My changes affect the state
  • I have included a state migration and a unit test for it

Copy link
Contributor

@DayS1eeper DayS1eeper left a comment

Choose a reason for hiding this comment

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

The current approach validates the value only when the resource is created (need to add the validation during the update ).
Can we add ValidateFunc to the Schema of var_files Elem ?
pros:

  • validation is executed during plan phase (currently during apply)
  • validation is executed on create and on update

@petroprotsakh
Copy link
Member Author

The current approach validates the value only when the resource is created (need to add the validation during the update ). Can we add ValidateFunc to the Schema of var_files Elem ? pros:

  • validation is executed during plan phase (currently during apply)
  • validation is executed on create and on update

@DayS1eeper unfortunately we can not. ValidateFunc is supported only for primitive types and does not work on lists or sets: https://developer.hashicorp.com/terraform/plugin/sdkv2/schemas/schema-behaviors#validatefunc.
Added same validation on resource update (interesting to know, the bug does not reproduce on update).
JFYI the actual root cause of the bug is known for years too hashicorp/terraform-plugin-sdk#216

@emocharnik emocharnik merged commit c3651c2 into develop Nov 14, 2022
@emocharnik emocharnik deleted the fix/SCALRCORE-24000 branch November 14, 2022 09:10
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.

3 participants