Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Renaming _type to pulp_type
Browse files Browse the repository at this point in the history
  • Loading branch information
fao89 committed Oct 3, 2019
1 parent 7ad5a68 commit 61b96b3
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGES/5454.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change `_type` to `pulp_type`
8 changes: 4 additions & 4 deletions docs/_static/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@
"format": "date-time",
"readOnly": true
},
"_type": {
"pulp_type": {
"title": " type",
"type": "string",
"readOnly": true,
Expand Down Expand Up @@ -1329,7 +1329,7 @@
"format": "date-time",
"readOnly": true
},
"_type": {
"pulp_type": {
"title": " type",
"type": "string",
"readOnly": true,
Expand Down Expand Up @@ -1414,7 +1414,7 @@
"format": "date-time",
"readOnly": true
},
"_type": {
"pulp_type": {
"title": " type",
"type": "string",
"readOnly": true,
Expand Down Expand Up @@ -1693,7 +1693,7 @@
"format": "date-time",
"readOnly": true
},
"_type": {
"pulp_type": {
"title": " type",
"type": "string",
"readOnly": true,
Expand Down
2 changes: 1 addition & 1 deletion docs/workflows/sync.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Remote GET Response::
"pulp_created": "2019-09-05T14:29:44.267406Z",
"pulp_href": "/pulp/api/v3/remotes/docker/docker/1cc699b7-24fd-4944-bde7-86aed8ac12fa/",
"pulp_last_updated": "2019-09-05T14:29:44.267428Z",
"_type": "docker.docker",
"pulp_type": "docker.docker",
"download_concurrency": 20,
"name": "my-hello-repo",
"policy": "immediate",
Expand Down
2 changes: 1 addition & 1 deletion pulp_docker/app/tasks/recursive_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def recursive_add_content(repository_pk, content_units):
latest_version = RepositoryVersion.latest(repository)
if latest_version:
tags_in_repo = latest_version.content.filter(
_type="docker.tag"
pulp_type="docker.tag"
)
tags_to_replace = Tag.objects.filter(
pk__in=tags_in_repo,
Expand Down
6 changes: 3 additions & 3 deletions pulp_docker/app/tasks/recursive_remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ def recursive_remove_content(repository_pk, content_units):
latest_version = RepositoryVersion.latest(repository)
latest_content = latest_version.content.all() if latest_version else Content.objects.none()

tags_in_repo = Q(pk__in=latest_content.filter(_type='docker.tag'))
manifests_in_repo = Q(pk__in=latest_content.filter(_type='docker.manifest'))
tags_in_repo = Q(pk__in=latest_content.filter(pulp_type='docker.tag'))
manifests_in_repo = Q(pk__in=latest_content.filter(pulp_type='docker.manifest'))
user_provided_content = Q(pk__in=content_units)
type_manifest_list = Q(media_type=MEDIA_TYPE.MANIFEST_LIST)
type_manifest = Q(media_type__in=[MEDIA_TYPE.MANIFEST_V1, MEDIA_TYPE.MANIFEST_V2])
blobs_in_repo = Q(pk__in=latest_content.filter(_type='docker.blob'))
blobs_in_repo = Q(pk__in=latest_content.filter(pulp_type='docker.blob'))

# Tags do not have must_remain because they are the highest level content.
tags_to_remove = Tag.objects.filter(user_provided_content & tags_in_repo)
Expand Down
2 changes: 1 addition & 1 deletion pulp_docker/app/tasks/untag.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def untag_image(tag, repository_pk):
latest_version = RepositoryVersion.latest(repository)

tags_in_latest_repository = latest_version.content.filter(
_type="docker.tag"
pulp_type="docker.tag"
)

tags_to_remove = Tag.objects.filter(
Expand Down
4 changes: 2 additions & 2 deletions pulp_docker/app/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def create(self, request):
source_latest = serializer.validated_data['source_repository_version']
destination = serializer.validated_data['destination_repository']
content_tags_in_repo = source_latest.content.filter(
_type="docker.tag"
pulp_type="docker.tag"
)
tags_in_repo = models.Tag.objects.filter(
pk__in=content_tags_in_repo,
Expand Down Expand Up @@ -357,7 +357,7 @@ def create(self, request):
source_latest = serializer.validated_data['source_repository_version']
destination = serializer.validated_data['destination_repository']
content_manifests_in_repo = source_latest.content.filter(
_type="docker.manifest"
pulp_type="docker.manifest"
)
manifests_in_repo = models.Manifest.objects.filter(
pk__in=content_manifests_in_repo,
Expand Down

0 comments on commit 61b96b3

Please sign in to comment.