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

Cannot manage launchdarkly_feature_flag_environment with rules containing boolean clauses #51

Closed
mvisonneau opened this issue Mar 10, 2021 · 5 comments

Comments

@mvisonneau
Copy link

Assuming the following existing configuration:

image

Importing it into the statefile or attempting to perform plan upon this resource results into the following error:

Error: failed to set rules on flag with key "dark-mode": rules.0.clauses.0.values.0: '' expected type 'string', got unconvertible type 'bool'
@ldhenry
Copy link
Collaborator

ldhenry commented Mar 10, 2021

Hi @mvisonneau,

This is a good find. I've filed an internal ticket to get this fixed. I'll be sure to update you here when the updated release is available.

Thanks,
Henry

@mvisonneau
Copy link
Author

@ldhenry
Copy link
Collaborator

ldhenry commented Mar 10, 2021

Yeah, you got it. In order to avoid introducing a breaking change we will likely add a "valueType" argument to the clause schema with a default of "string" that will let you specify what type of values the provider should use for the "values" array.

Unfortunately this means that we will not be able to support polymorphic types in the values array in a v1.X release, but I think this is acceptable for the majority of use cases.

For v2 we will likely break the schema to support polymorphic value types.

ldhenry added a commit that referenced this issue Mar 16, 2021
BUG FIXES:

    Fixed a bug preventing number and boolean values in targeting rules clauses from working. The new value_type attribute must be set in order to utilize number and boolean values. All values for a given targeting rule clause must be of the same type. #51
@ldhenry
Copy link
Collaborator

ldhenry commented Mar 16, 2021

Hi @mvisonneau,

I just published v1.5.1 of the provider which includes a fix for this issue. After upgrading, you will have to set the rule clause's value_type to boolean in order to manage rules with boolean clauses.

Thanks for reporting this,
Henry

@ldhenry ldhenry closed this as completed Mar 16, 2021
@mvisonneau
Copy link
Author

Brilliant, thanks a lot @ldhenry, it works like a charm now 🙇 👌

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

No branches or pull requests

2 participants