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

OpenTofu - Importing docker_proxy with index set to type "REGISTRY" causes Error #489

Open
1 task done
threadcrux opened this issue Jan 21, 2025 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@threadcrux
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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 Version

OpenTofu 1.9.0

Nexus Provider Version

2.5.0

Nexus Version

3.75.1

Affected Resource(s)/Data Source(s)

nexus_repository_docker_proxy

Terraform Configuration Files

terraform {
  required_providers {
    nexus = {
      source = "datadrivers/nexus"
      version = "2.5.0"
    }
  }
}
provider "nexus" {
  insecure = true
  password = "<blah>"
  url      = "<blah>"
  username = "<blah>"
}
import {
  to = nexus_repository_docker_proxy.quay
  id = "quay"
}

Debug Output/Panic Output

╷
│ Error: invalid value for docker_proxy.0.index_url (index_url should be in the format 'http://www.example.com')
│ 
│   with nexus_repository_docker_proxy.quay,
│   on gen.tf line 15:
│   (source code not available)
│

Expected Behaviour

Generate a config without error

Actual Behaviour

It does generate the config successfully but blows out the error Error: invalid value for docker_proxy.0.index_url

resource "nexus_repository_docker_proxy" "quay" {
  name         = "quay"
  online       = true
  routing_rule = ""
  docker {
    force_basic_auth = true
    http_port        = 0
    https_port       = 0
    subdomain        = ""
    v1_enabled       = false
  }
  docker_proxy {
    cache_foreign_layers        = false
    foreign_layer_url_whitelist = []
    index_type                  = "REGISTRY"
    index_url                   = ""
  }
  http_client {
    auto_block = true
    blocked    = false
    connection {
      enable_circular_redirects = false
      enable_cookies            = false
      retries                   = 0
      timeout                   = 0
      use_trust_store           = true
      user_agent_suffix         = ""
    }
  }
  negative_cache {
    enabled = true
    ttl     = 1440
  }
  proxy {
    content_max_age  = 1440
    metadata_max_age = 1440
    remote_url       = "https://quay.io"
  }
  storage {
    blob_store_name                = "docker-cache"
    strict_content_type_validation = true
  }
}

Steps to Reproduce

  1. Have /or Add a docker proxy with the index set to Use proxy registry (specified above)

Image

  1. Use provided terraform to try importing AND generating config using the command
    tofu plan -generate-config-out=gen.tf

References

No response

@threadcrux threadcrux added the bug Something isn't working label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant