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

refactor: Base ContainerRegistry's scan_tag and implement MEDIA_TYPE_DOCKER_MANIFEST type handling #2620

Conversation

jopemachine
Copy link
Member

@jopemachine jopemachine commented Aug 3, 2024

base.py's _scan_tag update for handling MEDIA_TYPE_DOCKER_MANIFEST

In the existing code, only MEDIA_TYPE_DOCKER_MANIFEST_LIST and MEDIA_TYPE_OCI_INDEX types were handled in _scan_tag, so a runtime error occurred when MEDIA_TYPE_DOCKER_MANIFEST type was passed as content_type.

However, in harbor.py, handling based on manifest_media_type is processed by separate functions such as _process_oci_index and _process_docker_v2_multiplatform_image, so handling for MEDIA_TYPE_DOCKER_MANIFEST has been added by extracting these functions with the same signatures.

Adding handling for the MEDIA_TYPE_DOCKER_MANIFEST type (_process_docker_v2_image) seems not to be specific only to ghcr, so it was added to base.py.

Checklist: (if applicable)

  • Milestone metadata specifying the target backport version

@github-actions github-actions bot added comp:manager Related to Manager component size:L 100~500 LoC labels Aug 3, 2024
@jopemachine jopemachine force-pushed the topic/08-02-feat_implement_id-based_client_workflow_to_containerregistry_api branch from 63dc857 to e1af726 Compare August 3, 2024 02:11
@jopemachine jopemachine force-pushed the topic/08-03-refactor_base_containerregistry_s_scan_tag_and_implement_media_type_docker_manifest_type_handling branch from 36de125 to 8c4d8c0 Compare August 3, 2024 02:11
@jopemachine jopemachine marked this pull request as ready for review August 3, 2024 03:09
@jopemachine jopemachine added this to the 24.09 milestone Aug 3, 2024
@jopemachine jopemachine force-pushed the topic/08-02-feat_implement_id-based_client_workflow_to_containerregistry_api branch from e1af726 to 18bd46c Compare August 3, 2024 05:23
@jopemachine jopemachine force-pushed the topic/08-03-refactor_base_containerregistry_s_scan_tag_and_implement_media_type_docker_manifest_type_handling branch from 68c9931 to 429d3f8 Compare August 3, 2024 05:23
@jopemachine jopemachine added type:refactor Refactor codes or add tests. type:feature Add new features labels Aug 3, 2024
@fregataa fregataa force-pushed the topic/08-02-feat_implement_id-based_client_workflow_to_containerregistry_api branch 4 times, most recently from 9213281 to fe6820e Compare August 4, 2024 02:45
@jopemachine jopemachine force-pushed the topic/08-02-feat_implement_id-based_client_workflow_to_containerregistry_api branch from 88562c8 to 6a1908e Compare August 5, 2024 06:20
@jopemachine jopemachine force-pushed the topic/08-03-refactor_base_containerregistry_s_scan_tag_and_implement_media_type_docker_manifest_type_handling branch from 429d3f8 to 8cfc934 Compare August 5, 2024 06:20
@jopemachine jopemachine force-pushed the topic/08-02-feat_implement_id-based_client_workflow_to_containerregistry_api branch from 6a1908e to 6688f0c Compare August 5, 2024 09:03
@jopemachine jopemachine force-pushed the topic/08-03-refactor_base_containerregistry_s_scan_tag_and_implement_media_type_docker_manifest_type_handling branch from 8cfc934 to c1e19f3 Compare August 5, 2024 09:03
@jopemachine jopemachine force-pushed the topic/08-02-feat_implement_id-based_client_workflow_to_containerregistry_api branch from 6688f0c to c23d3c3 Compare August 6, 2024 01:54
@jopemachine jopemachine force-pushed the topic/08-03-refactor_base_containerregistry_s_scan_tag_and_implement_media_type_docker_manifest_type_handling branch from c1e19f3 to 1003434 Compare August 6, 2024 01:54
@jopemachine jopemachine force-pushed the topic/08-02-feat_implement_id-based_client_workflow_to_containerregistry_api branch from c23d3c3 to edfc821 Compare August 6, 2024 01:58
@jopemachine jopemachine force-pushed the topic/08-03-refactor_base_containerregistry_s_scan_tag_and_implement_media_type_docker_manifest_type_handling branch from 1003434 to 0bbb489 Compare August 6, 2024 01:58
@jopemachine jopemachine force-pushed the topic/08-02-feat_implement_id-based_client_workflow_to_containerregistry_api branch from 80c0f6d to 3f749a8 Compare September 30, 2024 14:36
@jopemachine jopemachine force-pushed the topic/08-03-refactor_base_containerregistry_s_scan_tag_and_implement_media_type_docker_manifest_type_handling branch from 5a7b249 to 0d22e40 Compare September 30, 2024 14:36
@jopemachine jopemachine modified the milestones: 24.03, 24.09 Sep 30, 2024
Base automatically changed from topic/08-02-feat_implement_id-based_client_workflow_to_containerregistry_api to main September 30, 2024 15:00
@kyujin-cho kyujin-cho added this pull request to the merge queue Sep 30, 2024
Merged via the queue into main with commit a4b9b3c Sep 30, 2024
19 checks passed
@kyujin-cho kyujin-cho deleted the topic/08-03-refactor_base_containerregistry_s_scan_tag_and_implement_media_type_docker_manifest_type_handling branch September 30, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:manager Related to Manager component size:L 100~500 LoC type:feature Add new features type:refactor Refactor codes or add tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants