From eab9d384fda9e29d35be8a37dd78ed7d301d5bce Mon Sep 17 00:00:00 2001 From: jovial Date: Thu, 20 Jan 2022 12:50:24 +0000 Subject: [PATCH 1/5] Docs: Adds 'Working with pulp' --- README.rst | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/README.rst b/README.rst index e481fe6a11..e2508a7897 100644 --- a/README.rst +++ b/README.rst @@ -126,6 +126,62 @@ for information on how to run them. ``production`` distribution. Typically this would be done only once the new packages have been validated in a development or staging environment. +Working with pulp +================= + +The `pulp_cli tool +`__ can be used to administer your local +pulp installastion. Please follow the upstream documentation for installation +instructions. + +pulp_cli tricks +--------------- + +Saving credentials +~~~~~~~~~~~~~~~~~~ + +This is useful to avoid the need to always supply your credentials when running commands +from the command line: + +.. code-block:: console + + (venv-pulp) [stack@seed ~]$ pulp config create --username admin --base-url http://:8080 --password + + +Troubleshoting +-------------- + +HTTP Error 400: Bad Request {"name":["This field must be unique."]} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you have previously tried to push an image to pulp e.g for local testing, you may +see this message when you later try to run ``pulp-container-sync.yml``: + +.. code-block:: console + + TASK [stackhpc.pulp.pulp_repository : Setup container repositories] ***************************** + failed: [localhost] (item=stackhpc/centos-source-prometheus-jiralert) => changed=false + ansible_loop_var: item + item: + name: stackhpc/centos-source-prometheus-jiralert + policy: on_demand + remote_password: password + remote_username: username + state: present + url: https://ark.stackhpc.com + msg: 'HTTP Error 400: Bad Request b''{"name":["This field must be unique."]}''' + +The issue is that pulp will attempt to create a push repository on demand. This conflicts +with the on_demand repository under the stackhpc namespace. You can resolve this conflict +by deleting the push repository using pulp_cli: + +.. code-block:: console + + (venv-pulp) [stack@seed ~]$ pulp --base-url https://docker-registry.example.net --username admin --password $PULP_PASSWORD container distribution destroy --name stackhpc/centos-source-prometheus-msteams + Started background task /pulp/api/v3/tasks/1f0a474a-b7c0-44b4-9ef4-ed633077f4d8/ + .Done. + + Resources ========= From fcc62d4187a8ee8a6604640489ca575dc9f32497 Mon Sep 17 00:00:00 2001 From: jovial Date: Thu, 20 Jan 2022 12:53:48 +0000 Subject: [PATCH 2/5] Improve consistency --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index e2508a7897..d2db864fdd 100644 --- a/README.rst +++ b/README.rst @@ -177,7 +177,7 @@ by deleting the push repository using pulp_cli: .. code-block:: console - (venv-pulp) [stack@seed ~]$ pulp --base-url https://docker-registry.example.net --username admin --password $PULP_PASSWORD container distribution destroy --name stackhpc/centos-source-prometheus-msteams + (venv-pulp) [stack@seed ~]$ pulp --base-url http://:8080--username admin --password container distribution destroy --name stackhpc/centos-source-prometheus-jiralert Started background task /pulp/api/v3/tasks/1f0a474a-b7c0-44b4-9ef4-ed633077f4d8/ .Done. From 109129014c84fef0473847e2480c46b2cd82dfe3 Mon Sep 17 00:00:00 2001 From: jovial Date: Thu, 20 Jan 2022 15:22:14 +0000 Subject: [PATCH 3/5] Commit suggestions --- README.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index d2db864fdd..af5426dbe2 100644 --- a/README.rst +++ b/README.rst @@ -131,7 +131,7 @@ Working with pulp The `pulp_cli tool `__ can be used to administer your local -pulp installastion. Please follow the upstream documentation for installation +pulp installation. Please follow the upstream documentation for installation instructions. pulp_cli tricks @@ -148,7 +148,7 @@ from the command line: (venv-pulp) [stack@seed ~]$ pulp config create --username admin --base-url http://:8080 --password -Troubleshoting +Troubleshooting -------------- HTTP Error 400: Bad Request {"name":["This field must be unique."]} @@ -171,9 +171,11 @@ see this message when you later try to run ``pulp-container-sync.yml``: url: https://ark.stackhpc.com msg: 'HTTP Error 400: Bad Request b''{"name":["This field must be unique."]}''' -The issue is that pulp will attempt to create a push repository on demand. This conflicts -with the on_demand repository under the stackhpc namespace. You can resolve this conflict -by deleting the push repository using pulp_cli: +The issue is that pushing an image automatically creates a `container-push repository +`__ +which conflicts with the creation of a regular container repository of the same +name. You can resolve this conflict by deleting the distribution associated +with the push repository using the pulp CLI: .. code-block:: console From 90d3cfb566ae622f106d3208d897930f55ed4dbc Mon Sep 17 00:00:00 2001 From: jovial Date: Thu, 20 Jan 2022 15:46:28 +0000 Subject: [PATCH 4/5] Style fix --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index af5426dbe2..ebf6e1ed96 100644 --- a/README.rst +++ b/README.rst @@ -134,7 +134,7 @@ The `pulp_cli tool pulp installation. Please follow the upstream documentation for installation instructions. -pulp_cli tricks +pulp CLI tricks --------------- Saving credentials From 775842ddde88cd73e55e60bea3be8e505e8decae Mon Sep 17 00:00:00 2001 From: jovial Date: Thu, 20 Jan 2022 15:48:06 +0000 Subject: [PATCH 5/5] Style fix --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index ebf6e1ed96..40b99f093c 100644 --- a/README.rst +++ b/README.rst @@ -129,8 +129,8 @@ for information on how to run them. Working with pulp ================= -The `pulp_cli tool -`__ can be used to administer your local +The `pulp CLI +`__ tool can be used to administer your local pulp installation. Please follow the upstream documentation for installation instructions.