Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add float64 to supported sensitve fields #290

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Lax77
Copy link

@Lax77 Lax77 commented Aug 3, 2022

Description of your changes

Add support for float64 data type as sensitive field. We ran into an issue while upgrading provide-jet-datadog to latest release of terraform-provider-datadog as it introduced numeric sensitive field client_token_id of type float64

Fixes # #287

I have:

  • Read and followed Crossplane's [contribution process].
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

  • make generate on a jet provider

  • make reviewable test on a jet provider

@Kerwood
Copy link

Kerwood commented Aug 26, 2022

How is it going with this one ? Can we get this accepted ?

@@ -98,7 +99,7 @@ func NewSensitiveField(g *Builder, cfg *config.Resource, r *resource, sch *schem

f.TFTag = "-"
switch f.FieldType.String() {
case "string", "*string":
case "string", "*string", "float64", "*float64":
Copy link
Member

Choose a reason for hiding this comment

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

Have you tested this change manually and confirmed it works? Here is where we take the value from secret and then write to the TF file but it converts it to string before doing so. So, I think we may end up having a "231231241" as value instead of 231231241 in the main.tf.json, which Terraform may accept but better check if that's the case. Otherwise, we need to find a way to discover the type and convert it to that type before calling setSensitiveParametersWithPaved function. cc @turkenh

Copy link
Author

Choose a reason for hiding this comment

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

I have only tried upgrading terraform-provider-datadog to version v3.14 which seems to work. But did not try creating a resource with it that uses float64 for sensitive fields check. Will test it out and get back

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

Successfully merging this pull request may close these issues.

3 participants