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

docker_registry_image : Provider produced inconsistent final plan #192

Closed
dlaburthe opened this issue May 12, 2021 · 1 comment · Fixed by #198
Closed

docker_registry_image : Provider produced inconsistent final plan #192

dlaburthe opened this issue May 12, 2021 · 1 comment · Fixed by #198
Labels
bug Something isn't working r/registry_image
Milestone

Comments

@dlaburthe
Copy link
Contributor

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 "me too" comments, 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 (and docker Provider) Version

Terraform v0.15.3
kreuzwerker/docker v2.11.0

Affected Resource(s)

  • docker_registry_image

Terraform Configuration Files

resource "docker_registry_image" "images" {
  for_each = fileset("${path.cwd}/../../docker_files/", "*.dockerfile")

  name          = "${aws_ecr_repository.repo.repository_url}:${basename(trimsuffix(each.key, ".dockerfile"))}"
  keep_remotely = true

  build {
    context    = "${trimsuffix(path.cwd, "/terraform/main")}/docker_files/"
    dockerfile = each.key
  }
}

Debug Output

https://gist.github.com/dlaburthe/ba6b1e2e114ab96914a378045e14f2ea

Expected Behaviour

The images should have been built and deployed to the ECR registry.

Actual Behaviour

╷
│ Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for
│ docker_registry_image.images["image.dockerfile"] to
│ include new values learned so far during apply, provider
│ "registry.terraform.io/kreuzwerker/docker" produced an invalid new value
│ for .build[0].context: was
│ cty.StringVal("/opt/atlassian/pipelines/agent/build/docker_files/:e749c755d7c464779e052dea6d4526f0d8dfb7ba4e33d72794cf8b508f795047"),
│ but now
│ cty.StringVal("/opt/atlassian/pipelines/agent/build/docker_files/:ed66c6f3c8418a58bebf7ea7b560efebeac47857afa3780b485d9bfbf228a136").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵

Steps to Reproduce

  1. terraform plan -out planfile
  2. terraform apply planfile

Important Factoids

The execution process takes place in a bitbucket pipeline via two separate steps.

pipelines:
  custom:
    1.PLAN_APPLY:
      - step:
          name: Terraform plan
          artifacts:
            - terraform/main/.out/*.plan
          script:
            - ./scripts/deploy_terraform.sh plan
          services:
            - docker
      - step:
          name: Terraform apply
          trigger: manual
          script:
            - ./scripts/deploy_terraform.sh apply
          services:
            - docker
@mavogel mavogel added bug Something isn't working r/registry_image labels May 12, 2021
dlaburthe pushed a commit to dlaburthe/terraform-provider-docker that referenced this issue May 20, 2021
@mavogel mavogel linked a pull request May 21, 2021 that will close this issue
mavogel pushed a commit that referenced this issue May 21, 2021
@mavogel mavogel modified the milestones: v3.0.0, v2.12.0 May 21, 2021
@KanchiMoe
Copy link

This looks related to the issue I made ( #290 ) but I think I've found the cause of the problem, which I've put in the 'Actual Behaviour' section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working r/registry_image
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants