stx-puppet: add re-tries to workaround docker login failure 57/8157/1
authorJackie Huang <jackie.huang@windriver.com>
Mon, 23 Nov 2020 02:01:04 +0000 (10:01 +0800)
committerJackie Huang <jackie.huang@windriver.com>
Thu, 5 May 2022 12:50:39 +0000 (20:50 +0800)
Add re-tries to workaround the follwoing docker login failure:
Error: docker login registry.local:9001 -u admin -p St8rlingX* returned 1 instead of one of [0]
Error: /Stage[main]/Platform::Kubernetes::Master::Init/Exec[login local
       registry]/returns: change from notrun to 0 failed: docker login
       registry.local:9001 -u admin -p St8rlingX* returned 1 instead of one of [0]

Issue-ID: INF-215

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Change-Id: I83bc73bb0294428ca018ffd52c92d0dc8aaa8a0f

meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/stx-puppet/0011-puppet-manifest-kubernetes.pp-add-re-tries-for-docker-login.patch [new file with mode: 0644]
meta-starlingx/meta-stx-cloud/recipes-support/puppet/stx-puppet_git.bb

diff --git a/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/stx-puppet/0011-puppet-manifest-kubernetes.pp-add-re-tries-for-docker-login.patch b/meta-starlingx/meta-stx-cloud/recipes-support/puppet/files/stx-puppet/0011-puppet-manifest-kubernetes.pp-add-re-tries-for-docker-login.patch
new file mode 100644 (file)
index 0000000..cd3bf7e
--- /dev/null
@@ -0,0 +1,43 @@
+From 3d8cce4420f84bac979e9b10384fddb4d7c810d9 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Wed, 18 Nov 2020 09:45:54 +0800
+Subject: [PATCH] kubernetes.pp: add re-tries for docker login
+
+The docker login to local registry may sometimes fail:
+Error: docker login registry.local:9001 -u admin -p St8rlingX* returned 1 instead of one of [0]
+
+It's rare and the root cause is not found yet, but a re-try will always succeed,
+so add re-tries and a try sleep between re-tries to workaround it for now.
+
+Upstream-Status: Inappropriate [workaround]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ puppet-manifests/src/modules/platform/manifests/kubernetes.pp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/puppet-manifests/src/modules/platform/manifests/kubernetes.pp b/puppet-manifests/src/modules/platform/manifests/kubernetes.pp
+index 3fa1c8a..af69373 100644
+--- a/puppet-manifests/src/modules/platform/manifests/kubernetes.pp
++++ b/puppet-manifests/src/modules/platform/manifests/kubernetes.pp
+@@ -269,6 +269,8 @@ class platform::kubernetes::master::init
+     -> exec { 'login local registry':
+       command   => "docker login registry.local:9001 -u ${::platform::dockerdistribution::params::registry_username} -p ${::platform::dockerdistribution::params::registry_password}", # lint:ignore:140chars
+       logoutput => true,
++      tries     => 3,
++      try_sleep => 1,
+     }
+
+     -> exec { 'kubeadm to pre pull images':
+@@ -384,6 +386,8 @@ class platform::kubernetes::worker::init
+       exec { 'login local registry':
+         command   => "docker login registry.local:9001 -u ${::platform::dockerdistribution::params::registry_username} -p ${::platform::dockerdistribution::params::registry_password}", # lint:ignore:140chars
+         logoutput => true,
++        tries     => 3,
++        try_sleep => 1,
+       }
+
+       -> exec { 'load k8s pause image':
+--
+2.7.4
+
index e00a952..c8458be 100644 (file)
@@ -38,6 +38,7 @@ SRC_URI = " \
        file://${BPN}/0008-puppet-manifests-keystone-include-platform-client.patch \
        file://${BPN}/0009-puppet-manifests-lvm-remove-lvmetad.patch \
        file://${BPN}/0010-puppet-manifest-apply-workaround-to-ignore-known-err.patch \
+       file://${BPN}/0011-puppet-manifest-kubernetes.pp-add-re-tries-for-docker-login.patch \
        file://${BPN}/get-boot-device-from-cmdline.patch \
        file://${BPN}/poky-specific-apply-network-config-script.patch \
        file://${BPN}/apply_network_config_poky.sh \