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

File store object returns changes even if there are no changes in the script #908

Open
raj-dhamsaniya opened this issue Feb 19, 2024 · 0 comments

Comments

@raj-dhamsaniya
Copy link

raj-dhamsaniya commented Feb 19, 2024

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

1.4.6

Affected Resource(s)

Please list the resources as a list, for example:

  • harness_platform_file_store_file

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "harness_platform_file_store_file" "step_template_scripts" {
  for_each          = toset(local.script_names)
  identifier        = each.value
  name              = replace(each.value, "_", "-")
  parent_identifier = resource.harness_platform_file_store_folder.step_template_scripts_folder.identifier
  file_content_path = "../account/templates/scripts/${each.value}.sh"
  file_usage        = "SCRIPT"
}

Debug Output

is this needed in this case?
the change output I see is

  # harness_platform_file_store_file.step_template_scripts["terraform_export_output_1"] will be updated in-place
  ~ resource "harness_platform_file_store_file" "step_template_scripts" {
      - content           = <<-EOT
            export run_id=$(uuidgen)          
            cat << EOF > $run_id.json
<+pipeline.stages.<+stage.identifier>.spec.execution.steps.terraform_phase.steps.terraform_apply.output.TF_JSON_OUTPUT_ENCRYPTED>
            EOF  
            export encoded_tf_outputs=`cat $run_id.json | base64`
            echo $encoded_tf_outputs
            rm -rf $run_id.json
        EOT -> null
        id                = "terraform_export_output_1"
        name              = "terraform-export-output-1"
        tags              = []
        # (8 unchanged attributes hidden)
    }

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

It should have shown no change, if there is no change in the file.

Actual Behavior

It showed change as its moving file store file as NULL, but it actually keeps the same file. not sure if API call happens or not behind the scene.

Steps to Reproduce

Create file store script file and refer a local script from it. do apply couple of time, it would show change each time

Important Factoids

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

1 participant