Skip to content

Commit

Permalink
cnf ran: fix image registry automation issue (#208)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
klaskosk authored Sep 20, 2024
1 parent 7c3e1c3 commit bcabf0f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/cnf/ran/gitopsztp/tests/ztp-argocd-policies-app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand All @@ -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(
Expand Down

0 comments on commit bcabf0f

Please sign in to comment.