Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-27154

Artifactory YAML configuration update is allowing to create the repository names matching the repository layout

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 7.33.6, 7.35.0, 7.38.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      Problem Description:

      It is possible to update the config descriptor and create repositories using the YAML configuration.
      https://www.jfrog.com/confluence/display/JFROG/Artifactory+YAML+Configuration#ArtifactoryYAMLConfiguration-Repositories
      However, the Artifactory YAML configuration update is allowing to create the repository names matching the repository layout

      Steps to reproduce:

      Step 1:
      Create a repository layout named "repo-latout-test" using the below yaml

      configuration.yml
      repoLayouts:
        repo-latout-test:
          artifactPathPattern:'[org]/[orgPath]/[branch<master|feature/[\w/.-]|release/\d\.\d+(?:.)?|sop/[\w/.-]>]/[module]/[baseRevFrac1<[0-9a-f]

      {2}

      >]/[baseRevFrac2<[0-9a-f]

      {38}

      >]/[org][orgPath][normalizedBranch<master|feature_[\w/.-]|release_\d+\.\d+(?:.)?|sop_[\w/.-]>][module]-[baseRev]([classifier]).[ext]'
          descriptorPathPattern: ''
          distinctiveDescriptorPathPattern: 'false'
          fileIntegrationRevisionRegExp: .*
          folderIntegrationRevisionRegExp: .*

      command:
      curl -u<username>:<password> -X PATCH "http://localhost:8081/artifactory/api/system/configuration" -H "Content-Type: application/yaml" -T configuration.yml

      Step 2:
      Now, try to create a local and virtual repository with the below yaml

      Note: The name used for the virtual repository is the same name as created on repoLayout

      To create the local repo:
      localRepositories:
        repo-latout-test-local:
          description: repository for testing and playing around with artifactory
          repoLayout: repo-latout-test
          type: generic
       
      command:
      curl -u<username>:<password> -X PATCH "http://localhost:8081/artifactory/api/system/configuration" -H "Content-Type: application/yaml" -T local.yml
       
      To create virtual repo:

      virtualRepositories:
        repo-latout-test:
          defaultDeploymentRepo: repo-latout-test-local
          description: repository for testing and playing around with artifactory
          repoLayout: repo-latout-test
          repositories:
          - repo-latout-test-local
          type: generic

      curl -u<username>:<password> -X PATCH "http://localhost:8081/artifactory/api/system/configuration" -H "Content-Type: application/yaml" -T virtual.yml

      Since the repo layout and the repo name is same, the config descrtior cannot parse duplicate keys. When restarting Artifactory it impacts the service startup

       

      Expected behaviour: YAML configuration update should not allow same name for creating repository and repoLayout

      Tested version: 7.38.10, 7.33.12
      Environment: On-Prem & Standalone and HA
      Database: NA
      Severity: High
      Pain level: High

        Attachments

          Activity

              People

              Assignee:
              Unassigned
              Reporter:
              vigneshs Vignesh S
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: