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

Can't add dockerhub registry #433

Open
siegenthalerroger opened this issue Apr 30, 2024 · 1 comment
Open

Can't add dockerhub registry #433

siegenthalerroger opened this issue Apr 30, 2024 · 1 comment
Labels
question Further information is requested

Comments

@siegenthalerroger
Copy link

Describe the bug
When adding a "docker-hub" registry an error is thrown.

To Reproduce

  1. Attempt to add the following
resource "harbor_registry" "public-docker-hub" {
  name          = "public-docker-hub"
  endpoint_url  = "https://hub.docker.com"
  provider_name = "docker-hub"

  access_id     = var.registry-public-docker-hub-username
  access_secret = var.registry-public-docker-hub-secret
}
  1. An error is thrown and the registry not configured in Harbor.

Expected behavior
The registry to be added.

Additional context
I believe the error is due to the fact tat for a "docker-hub" type the "endpoint_url" shouldn't be set. However this is required by the terraform provider.

A workaround is to configure it manually in the webui and then import the existing resource. The provider doesn't detect any changes that need to be reconciled in this case.

  • Provider Version: 3.10.9
  • Terraform Version: >= 1.6.0
  • Harbor Version: 2.10.2
@flbla
Copy link
Contributor

flbla commented May 13, 2024

could you please copy the error you get?
I'm not able to repro the bug with this code :

resource "harbor_registry" "dockerhub" {
  provider_name = "docker-hub"
  name          = "test_docker_harbor"
  endpoint_url  = "https://hub.docker.com"
}
Terraform will perform the following actions:

  # harbor_registry.dockerhub will be created
  + resource "harbor_registry" "dockerhub" {
      + endpoint_url  = "https://hub.docker.com"
      + id            = (known after apply)
      + insecure      = false
      + name          = "test_docker_harbor"
      + provider_name = "docker-hub"
      + registry_id   = (known after apply)
      + status        = (known after apply)
    }

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

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

harbor_registry.dockerhub: Creating...
harbor_registry.dockerhub: Creation complete after 1s [id=/registries/3]

@flbla flbla added the question Further information is requested label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants