From bcabf0fd2a9478cd343b3a7601f9a94b4161546c Mon Sep 17 00:00:00 2001 From: Kirsten Laskoski Date: Fri, 20 Sep 2024 09:39:55 -0400 Subject: [PATCH] cnf ran: fix image registry automation issue (#208) The image registry test in ztp-argocd-policies-app.go has been consistently failing in CI because restoring the image registry would fail. This PR fixes that issue by saving an the image registry config earlier in the test so that it can be restored properly. --- tests/cnf/ran/gitopsztp/tests/ztp-argocd-policies-app.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/cnf/ran/gitopsztp/tests/ztp-argocd-policies-app.go b/tests/cnf/ran/gitopsztp/tests/ztp-argocd-policies-app.go index 31413d575..973983186 100644 --- a/tests/cnf/ran/gitopsztp/tests/ztp-argocd-policies-app.go +++ b/tests/cnf/ran/gitopsztp/tests/ztp-argocd-policies-app.go @@ -132,10 +132,14 @@ var _ = Describe("ZTP Argo CD Policies Tests", Label(tsparams.LabelArgoCdPolicie // 54354 - Ability to configure local registry via du profile It("verifies the image registry exists", reportxml.ID("54354"), func() { + By("saving image registry config before modification") + imageRegistryConfig, _ = imageregistry.Pull(Spoke1APIClient, tsparams.ImageRegistryName) + By("updating Argo CD policies app") exists, err := gitdetails.UpdateArgoCdAppGitPath( tsparams.ArgoCdPoliciesAppName, tsparams.ZtpTestPathImageRegistry, true) if !exists { + imageRegistryConfig = nil Skip(err.Error()) } @@ -149,9 +153,6 @@ var _ = Describe("ZTP Argo CD Policies Tests", Label(tsparams.LabelArgoCdPolicie fmt.Sprintf("ls %s", tsparams.ImageRegistryPath)) Expect(err).ToNot(HaveOccurred(), "Image registry directory '%s' does not exist", tsparams.ImageRegistryPath) - imageRegistryConfig, err = imageregistry.Pull(Spoke1APIClient, tsparams.ImageRegistryName) - Expect(err).ToNot(HaveOccurred(), "Failed to pull image registry config") - By("waiting for the policies to exist and be compliant") for _, policyName := range tsparams.ImageRegistryPolicies { policy, err := helper.WaitForPolicyToExist(