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

Pulp_file content for repository version no. 0 should be empty after syncing #415

Closed
lubosmj opened this issue Nov 5, 2021 · 3 comments · Fixed by #416
Closed

Pulp_file content for repository version no. 0 should be empty after syncing #415

lubosmj opened this issue Nov 5, 2021 · 3 comments · Fixed by #416
Assignees
Labels
bug Something isn't working (template-set)
Milestone

Comments

@lubosmj
Copy link
Member

lubosmj commented Nov 5, 2021

Summary

After syncing a clean pulp_file repository, the content in repository version no. 0 should be always empty.

Steps to reproduce

pulp file repository create --name foo
pulp file remote create --name foo --url https://fixtures.pulpproject.org/file/PULP_MANIFEST
pulp file repository sync --name foo --remote foo
(pulp) [vagrant@pulp3-source-fedora34 devel]$ pulp file repository content list --repository foo --version 0
[
  {
    "pulp_href": "/pulp/api/v3/content/file/files/9a4bac54-0fca-4a0c-a460-1ad4f0405ef5/",
    "pulp_created": "2021-11-05T09:53:30.106659Z",
    "artifact": "/pulp/api/v3/artifacts/b46dc9dc-5fea-41a2-9367-e304f6879ea9/",
    "relative_path": "3.iso",
    "md5": null,
    "sha1": null,
    "sha224": "f8cb654de26f8a1c236f6c66722f50785a1cca295aaff3dbe41b31f6",
    "sha256": "f18ab30fc5c52fc5206d9f87ee8b5f4adcb1f09ee452920e6e2ee2ba42600651",
    "sha384": "76e250e95cce15916a10d73a92886de141e320eb5d420d7caf8493db366b67a2c86359f50f98a590213d2a8e919670b6",
    "sha512": "fe80cc520088100990b90abebf5b637a9febfc0033dc69aeeded77d0d099be9ff1495aebaa36517c946dfa79beab6141764202bfae10f66c702e16d185abb467"
  },
  {
    "pulp_href": "/pulp/api/v3/content/file/files/3d2c4b66-1a76-48fe-badb-a276e41c03ec/",
    "pulp_created": "2021-11-05T09:53:30.105093Z",
    "artifact": "/pulp/api/v3/artifacts/e2d09e46-f792-445e-a791-5d95d04dcb99/",
    "relative_path": "2.iso",
    "md5": null,
    "sha1": null,
    "sha224": "9574a87c33657b3deb829b55d3e72859ea5ee752b1f10736a27ce9f4",
    "sha256": "327ac83861f3e3fcaa115ddd7f91f8d796f55bb1013ea1bd1cc377e28e3ee9cf",
    "sha384": "c7a067d0222966f1a3f9e157b33025826d74fcc47e89db8c3f9ed79ec6aa28632d61e5a5bb4585735c11afdf961af474",
    "sha512": "ab10f6e0f189365b9bda9a9e06f4588f420e57112c40f455e65c15603adf068388a8c603abf0740f9f5f8efc2734e4462ae48956f35b212a2b6717d671d89ff6"
  },
  {
    "pulp_href": "/pulp/api/v3/content/file/files/fcad7395-a4bc-48fd-8042-e14e504ad889/",
    "pulp_created": "2021-11-05T09:53:30.102662Z",
    "artifact": "/pulp/api/v3/artifacts/f43b5de2-82da-4542-8e80-01f137df4d06/",
    "relative_path": "1.iso",
    "md5": null,
    "sha1": null,
    "sha224": "f3ca9c7a7018adad7e49c403c3043379fafc2244c2df8a32830d6b2b",
    "sha256": "cbd074de731a7a28fc3257769c417dc2f579ac7a9e072423305033a2bed79033",
    "sha384": "93120442e279509fa41c30722922a3c04b5a40acbd893672dfc2d3987299016000f799432b3361b8baefaf9a0cfaf0a9",
    "sha512": "d17d393e59fb439176e61f3bae105e423196817da7da8efbba3e6d304359f50bb212f98c5bf8e39fd7e6ffa50b59cafcf11a43100aed4366c997908dc95e20c0"
  }
]

Expected behaviour

(pulp) [vagrant@pulp3-source-fedora34 devel]$ pulp file repository content list --repository foo --version 0
[]
@lubosmj lubosmj added the bug Something isn't working (template-set) label Nov 5, 2021
@lubosmj
Copy link
Member Author

lubosmj commented Nov 5, 2021

The Pulp API correctly returns the versioned content:

(pulp) [vagrant@pulp3-source-fedora34 devel]$ http :24817/pulp/api/v3/content/file/files/?repository_version_added=/pulp/api/v3/repositories/file/file/2671d870-c210-4216-8bad-6e3aab5dc8f5/versions/1/
HTTP/1.1 200 OK
Access-Control-Expose-Headers: Correlation-ID
Allow: GET, POST, HEAD, OPTIONS
Connection: close
Content-Length: 1983
Content-Type: application/json
Correlation-ID: 0a0c8aea1bbf4e078844c3adf4ae97ef
Date: Fri, 05 Nov 2021 10:12:59 GMT
Referrer-Policy: same-origin
Server: gunicorn
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
X-Frame-Options: DENY

{
    "count": 3,
    "next": null,
    "previous": null,
    "results": [
        {
            "artifact": "/pulp/api/v3/artifacts/0cc76c59-7aad-4b72-bc93-8d299c723d9d/",
            "md5": null,
            "pulp_created": "2021-11-05T10:12:35.738001Z",
            "pulp_href": "/pulp/api/v3/content/file/files/1d5e159d-c464-4c45-97cb-f0fbc26c4af1/",
            "relative_path": "3.iso",
            "sha1": null,
            "sha224": "f8cb654de26f8a1c236f6c66722f50785a1cca295aaff3dbe41b31f6",
            "sha256": "f18ab30fc5c52fc5206d9f87ee8b5f4adcb1f09ee452920e6e2ee2ba42600651",
            "sha384": "76e250e95cce15916a10d73a92886de141e320eb5d420d7caf8493db366b67a2c86359f50f98a590213d2a8e919670b6",
            "sha512": "fe80cc520088100990b90abebf5b637a9febfc0033dc69aeeded77d0d099be9ff1495aebaa36517c946dfa79beab6141764202bfae10f66c702e16d185abb467"
        },
        {
            "artifact": "/pulp/api/v3/artifacts/09e07df9-a7de-4a4b-8b9d-9f60060ecd61/",
            "md5": null,
            "pulp_created": "2021-11-05T10:12:35.736744Z",
            "pulp_href": "/pulp/api/v3/content/file/files/4c5fa4d1-56a8-431e-937a-d3b502e0dac2/",
            "relative_path": "2.iso",
            "sha1": null,
            "sha224": "9574a87c33657b3deb829b55d3e72859ea5ee752b1f10736a27ce9f4",
            "sha256": "327ac83861f3e3fcaa115ddd7f91f8d796f55bb1013ea1bd1cc377e28e3ee9cf",
            "sha384": "c7a067d0222966f1a3f9e157b33025826d74fcc47e89db8c3f9ed79ec6aa28632d61e5a5bb4585735c11afdf961af474",
            "sha512": "ab10f6e0f189365b9bda9a9e06f4588f420e57112c40f455e65c15603adf068388a8c603abf0740f9f5f8efc2734e4462ae48956f35b212a2b6717d671d89ff6"
        },
        {
            "artifact": "/pulp/api/v3/artifacts/9fae6d2f-3e84-417a-8457-fb3a942f874f/",
            "md5": null,
            "pulp_created": "2021-11-05T10:12:35.734485Z",
            "pulp_href": "/pulp/api/v3/content/file/files/a3ade5b1-52db-4e25-936d-0e9892441f68/",
            "relative_path": "1.iso",
            "sha1": null,
            "sha224": "f3ca9c7a7018adad7e49c403c3043379fafc2244c2df8a32830d6b2b",
            "sha256": "cbd074de731a7a28fc3257769c417dc2f579ac7a9e072423305033a2bed79033",
            "sha384": "93120442e279509fa41c30722922a3c04b5a40acbd893672dfc2d3987299016000f799432b3361b8baefaf9a0cfaf0a9",
            "sha512": "d17d393e59fb439176e61f3bae105e423196817da7da8efbba3e6d304359f50bb212f98c5bf8e39fd7e6ffa50b59cafcf11a43100aed4366c997908dc95e20c0"
        }
    ]
}


(pulp) [vagrant@pulp3-source-fedora34 devel]$ http :24817/pulp/api/v3/content/file/files/?repository_version_added=/pulp/api/v3/repositories/file/file/2671d870-c210-4216-8bad-6e3aab5dc8f5/versions/0/
HTTP/1.1 200 OK
Access-Control-Expose-Headers: Correlation-ID
Allow: GET, POST, HEAD, OPTIONS
Connection: close
Content-Length: 52
Content-Type: application/json
Correlation-ID: ef2a1f0f87a94753932aff2cd0d704fc
Date: Fri, 05 Nov 2021 10:13:01 GMT
Referrer-Policy: same-origin
Server: gunicorn
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
X-Frame-Options: DENY

{
    "count": 0,
    "next": null,
    "previous": null,
    "results": []
}

@mdellweg
Copy link
Member

mdellweg commented Nov 5, 2021

can you rerun the command with "-vv --format none --dry-run" to see the actual query produced?

@lubosmj
Copy link
Member Author

lubosmj commented Nov 5, 2021

(pulp) [vagrant@pulp3-source-fedora34 devel]$ pulp -vv --format none --dry-run file repository content list --repository foo --version 0
get http://pulp3-source-fedora34.localhost.example.com/pulp/api/v3/repositories/file/file/?name=foo&offset=0&limit=1
  User-Agent: python-requests/2.26.0
  Accept-Encoding: gzip, deflate
  Accept: application/json
  Connection: keep-alive
  Authorization: Basic YWRtaW46cGFzc3dvcmQ=
Response: 200
get http://pulp3-source-fedora34.localhost.example.com/pulp/api/v3/repositories/file/file/2671d870-c210-4216-8bad-6e3aab5dc8f5/versions/1/
  User-Agent: python-requests/2.26.0
  Accept-Encoding: gzip, deflate
  Accept: application/json
  Connection: keep-alive
  Authorization: Basic YWRtaW46cGFzc3dvcmQ=
Response: 200
get http://pulp3-source-fedora34.localhost.example.com/pulp/api/v3/content/file/files/?repository_version=%2Fpulp%2Fapi%2Fv3%2Frepositories%2Ffile%2Ffile%2F2671d870-c210-4216-8bad-6e3aab5dc8f5%2Fversions%2F1%2F&offset=0&limit=25
  User-Agent: python-requests/2.26.0
  Accept-Encoding: gzip, deflate
  Accept: application/json
  Connection: keep-alive
  Authorization: Basic YWRtaW46cGFzc3dvcmQ=
Response: 200

@mdellweg mdellweg self-assigned this Nov 5, 2021
@mdellweg mdellweg added this to the 0.13.0 milestone Nov 5, 2021
mdellweg added a commit to mdellweg/pulp-cli that referenced this issue Nov 5, 2021
gerrod3 pushed a commit that referenced this issue Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working (template-set)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants