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

Code Engine constantly displaying run_env_variables diff on plan job #4852

Closed
SRodi opened this issue Oct 10, 2023 · 3 comments
Closed

Code Engine constantly displaying run_env_variables diff on plan job #4852

SRodi opened this issue Oct 10, 2023 · 3 comments
Labels
service/Code Engine service/Resource Management Issues related to Resource Manager or Resource controller Issues

Comments

@SRodi
Copy link
Contributor

SRodi commented Oct 10, 2023

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform IBM Provider Version

❯ terraform -v
Terraform v1.5.7
on darwin_amd64
terraform {
  required_version = ">=1.3.0, <2.0"
  required_providers {
    ibm = {
      source  = "IBM-Cloud/ibm"
      version = "1.58.0"
    }
  }
}

Affected Resource(s)

  • ibm_code_engine_job

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

data "ibm_resource_group" "resource_group"{
  name = "Default"
}

resource "ibm_code_engine_project" "code_engine_project_instance" {
  name              = "ce-project"
  resource_group_id = data.ibm_resource_group.resource_group.id
}

resource "ibm_code_engine_secret" "code_engine_secret_source" {
  project_id = ibm_code_engine_project.code_engine_project_instance.project_id
  name       = "source-secret"
  format     = "generic"
  data       = {
    some = "value"
  }
}

resource "ibm_code_engine_secret" "code_engine_secret_destination" {
  project_id = ibm_code_engine_project.code_engine_project_instance.project_id
  name       = "destination-secret"
  format     = "generic"
  data       = {
    some = "value"
  }
}

resource "ibm_code_engine_job" "code_engine_job_instance" {
  project_id      = ibm_code_engine_project.code_engine_project_instance.project_id
  name            = "ce-job"
  image_reference = "blabla"
  run_env_variables {
    type  = "literal"
    name  = "AUTH_ENDPOINT"
    value = "https://iam.cloud.ibm.com/identity/token"
  }
  run_env_variables {
    type      = "secret_full_reference"
    reference = ibm_code_engine_secret.code_engine_secret_source.name
  }
  run_env_variables {
    type      = "secret_full_reference"
    reference = ibm_code_engine_secret.code_engine_secret_destination.name
  }
}

Debug Output

n/a

Panic Output

n/a

Expected Behavior

After the first apply, and without any configuration changes, each consequent plan job should display no diff.

Actual Behavior

The plan job is constantly re-shuffling the env_variables and producing a misleading diff, similar to this:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.code_engine.ibm_code_engine_job.code_engine_job_instance will be updated in-place
  ~ resource "ibm_code_engine_job" "code_engine_job_instance" {
        id                            = "5a084d2a-bd8b-4989-be95-895aee689e20/ce-job"
        name                          = "ce-job"
        # (19 unchanged attributes hidden)

      ~ run_env_variables {
          + name      = "AUTH_ENDPOINT"
          - reference = "source-secret" -> null
          ~ type      = "secret_full_reference" -> "literal"
          + value     = "https://iam.cloud.ibm.com/identity/token"
        }
      ~ run_env_variables {
          ~ reference = "destination-secret" -> "source-secret"
            # (1 unchanged attribute hidden)
        }
      ~ run_env_variables {
          - name      = "AUTH_ENDPOINT" -> null
          + reference = "destination-secret"
          ~ type      = "literal" -> "secret_full_reference"
          - value     = "https://iam.cloud.ibm.com/identity/token" -> null
        }
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Steps to Reproduce

  1. terraform init
  2. terraform plan
  3. terraform apply
  4. terraform plan (again to see the unwanted diff)

Important Factoids

The issue is with run_env_variables argument of type list

Screenshot 2023-10-10 at 08 20 37

References

n/a

@github-actions github-actions bot added service/Code Engine service/Resource Management Issues related to Resource Manager or Resource controller Issues labels Oct 10, 2023
@data-henrik
Copy link
Contributor

#4719 might be the same

@michael-magrian
Copy link
Contributor

Hey @SRodi, thanks for reporting this.
As @data-henrik mentioned, this is a duplicate of #4719, and I suggest to close this here as a duplicate.
We will try to prioritize work on this, but I can't promise any timelines.

@SRodi
Copy link
Contributor Author

SRodi commented Oct 17, 2023

closing as duplicate of #4719

@SRodi SRodi closed this as completed Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/Code Engine service/Resource Management Issues related to Resource Manager or Resource controller Issues
Projects
None yet
Development

No branches or pull requests

3 participants