Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-26702

Unable to set latestPolicy with API repositories/docker/hosted endpoint

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: New
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.29.2, 3.30.0
    • Fix Version/s: None
    • Component/s: Docker, REST
    • Labels:
    • Environment:

      Description

      Currently it is not possible to set the latestPolicy setting with the REST API for docker hosted repositories.

      Reproduce

      1. login to nexus running version 3.29.2.
      2. use the provided api to send a test request with the latestPolicy set
      http://localhost:8081/#admin/system/api
      
      /v1/repositories/docker/hosted
      
      {
        "name": "internal-lastpolicy",
        "online": true,
        "storage": {
          "blobStoreName": "default",
          "strictContentTypeValidation": true,
          "writePolicy": "ALLOW_ONCE",
          "latestPolicy": true
        },
        "cleanup": {
          "policyNames": [
            "string"
          ]
        },
        "docker": {
          "v1Enabled": false,
          "forceBasicAuth": true,
          "httpPort": 8082,
          "httpsPort": 8083
        }
      }
      
      
      curl -X POST "http://localhost:8081/service/rest/v1/repositories/docker/hosted" -H  "accept: application/json" -H  "Content-Type: application/json" -d "{  \"name\": \"internal-lastpolicy\",  \"online\": true,  \"storage\": {    \"blobStoreName\": \"default\",    \"strictContentTypeValidation\": true,    \"writePolicy\": \"ALLOW_ONCE\",    \"latestPolicy\": true  },  \"cleanup\": {    \"policyNames\": [      \"string\"    ]  },  \"docker\": {    \"v1Enabled\": false,    \"forceBasicAuth\": true,    \"httpPort\": 8082,    \"httpsPort\": 8083  }}"
      
      
      201	
      Response headerscontent-length: 0  date: Fri, 12 Feb 2021 00:38:19 GMT  server: Nexus/3.29.2-02 (OSS)  x-content-type-options: nosniff 
      

      Outcome

       

      Expected

       

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            robert.gurtler Robert Gurtler
            Last Updated By:
            Joe Tom Joe Tom
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Date of First Response:

                tigCommentSecurity.panel-title