datadrivers/terraform-provider-nexus

Support for latestPolicy on Docker hosted repositories

nicoangelo opened this issue ยท 1 comments

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

Description

Since Nexus 3.21, Docker hosted repositories support to redeploy latest tags, while "Disable redeploy" is being set as Deployment policy. This is also exposed on the API:

{
  "name": "my-docker-hosted",
  "url": "...",
  "online": true,
  "storage": {
    "blobStoreName": "default",
    "strictContentTypeValidation": true,
    "writePolicy": "ALLOW_ONCE",
    "latestPolicy": true // <-- this one
  },
  "cleanup": null,
  "docker": {
    "v1Enabled": false,
    "forceBasicAuth": true,
    "httpPort": null,
    "httpsPort": null,
    "subdomain": null
  },
  "component": {
    "proprietaryComponents": false
  },
  "format": "docker",
  "type": "hosted"
}

I'm happy to provide a PR for this, if this is deemed a useful enhancement.

New or Affected Resource(s)/Data Source(s)

nexus_repository_docker_hosted

Pro feature

No

Community Plugin

No response

Potential Terraform Configuration

resource "nexus_repository_docker_hosted" "example" {
  name   = "example"
  online = true

  docker {
    force_basic_auth = false
    v1_enabled       = false
  }

  storage {
    blob_store_name                = "default"
    strict_content_type_validation = true
    write_policy                   = "ALLOW"
    latest_policy                  = true
  }
}

References

Nexus RM3 Documentation - Hosted Repository for Docker (Private Registry for Docker)