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

Commit

Permalink
Deprecate docker v1 support
Browse files Browse the repository at this point in the history
closes #4597
https://pulp.plan.io/issues/4597

(cherry picked from commit 49446be)
  • Loading branch information
ipanova authored and zjhuntin committed May 17, 2019
1 parent 3bd7079 commit ec132dd
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 47 deletions.
2 changes: 1 addition & 1 deletion docs/tech-reference/importer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The following options are available to the docker importer configuration.

``enable_v1``
Boolean to control whether to attempt using registry API v1 during
synchronization. Default is False.
synchronization. Default is False. DEPRECATED.

``enable_v2``
Boolean to control whether to attempt using registry API v2 during
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The importer supports the settings documented in Pulp's `importer config docs`_.
The following docker specific properties are supported:

``enable_v1``
Enables the docker v1 protocol. Defaults to False when not specified.
Enables the docker v1 protocol. Defaults to False when not specified. DEPRECATED.

``enable_v2``
Enables the docker v2 protocol. Defaults to True when not specified.
Expand Down
53 changes: 10 additions & 43 deletions docs/user-guide/recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,18 @@ Full documentation for /etc/crane.conf can be found in the Crane `README`_.
Sync
----

The pulp-docker plugin supports synchronizing from upstream repositories as of
version 0.2.1. As of version 2.0.0, it can synchronize with either Docker v1 or
v2 registries.
The pulp-docker plugin supports synchronizing from docker V2 API compatible registries.

<<<<<<< HEAD
.. note::
=======
.. warning::

``index.docker.io`` is a legacy registry and should be used only for V1 content, along with
``--enable-v1 true`` and ``--enable-v2 false``. Please note however that V1 content is
DEPRECATED and support may removed it at any time.
It is advived to use instead ``registry-1.docker.io`` for V2 content!
>>>>>>> 49446be... Deprecate docker v1 support

``registry-1.docker.io`` is a Docker V2 Registry API. For V1 API
``index.docker.io`` should be used, along with ``--enable-v1 true`` and
Expand Down Expand Up @@ -98,46 +105,6 @@ v2 registries.

Once this is complete, the data in the remote repository is now in your local Pulp instance.

As mentioned, it is still possible to synchronize Docker v1 content if you use
the old feed URL and enable/disable v1/v2::

$ pulp-admin docker repo create --repo-id=v1synctest --feed=https://index.docker.io --upstream-name=busybox --enable-v1 true --enable-v2 false
Repository [v1synctest] successfully created

$ pulp-admin docker repo sync run --repo-id v1synctest
+----------------------------------------------------------------------+
Synchronizing Repository [v1synctest]
+----------------------------------------------------------------------+

This command may be exited via ctrl+c without affecting the request.


Retrieving v1 metadata
[-]
... completed

Copying units already in pulp
[-]
... completed

Downloading remote files
[==================================================] 100%
53 of 53 items
... completed

Saving v1 images and tags
[-]
... completed


Task Succeeded




Task Succeeded


Whitelist Tags to Sync
----------------------

Expand Down
6 changes: 6 additions & 0 deletions docs/user-guide/release-notes/3.2.x.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
3.2 Release Notes
=================

3.2.4
-----

Docker V1 content support is deprecated! Switch to V2 content is advised.


3.2.3
-----

Expand Down
2 changes: 1 addition & 1 deletion extensions_admin/pulp_docker/extensions/admin/cudl.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
d = _('name of the upstream repository')
OPT_UPSTREAM_NAME = PulpCliOption('--upstream-name', d, required=False)

d = _('Enable sync of v1 API. defaults to "false"')
d = _('Enable sync of v1 API. defaults to "false." DEPRECATED.')
OPT_ENABLE_V1 = PulpCliOption('--enable-v1', d, required=False,
parse_func=okaara_parsers.parse_boolean)

Expand Down
3 changes: 2 additions & 1 deletion plugins/pulp_docker/plugins/importers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __init__(self, repo=None, conduit=None, config=None):
_logger.debug(_('v2 API found'))
self.add_v2_steps(repo, conduit, config)
if v1_found:
_logger.debug(_('v1 API found'))
_logger.debug(_('v1 API found. Sync from a v1 API registry is deprecated.'))
self.add_v1_steps(repo, config)
if not any((v1_found, v2_found)):
raise PulpCodedException(error_code=error_codes.DKR1008, registry=url)
Expand Down Expand Up @@ -126,6 +126,7 @@ def add_v1_steps(self, repo, config):
:param config: config object for the sync
:type config: pulp.plugins.config.PluginCallConfiguration
"""
_logger.warning("Sync from a V1 API registry is DEPRECATED!")
self.add_child(v1_sync.GetMetadataStep())
# save this step so its "units_to_download" attribute can be accessed later
self.v1_step_get_local_units = publish_step.GetLocalUnitsStep(
Expand Down

0 comments on commit ec132dd

Please sign in to comment.