Skip to content

Commit

Permalink
refactor(RHTAPREL-371): don't create rolebinding in release tests
Browse files Browse the repository at this point in the history
The RoleBinding granting access to the release-pipeline-resource-role in
the dev namespace is now created by the Release controller so no longer
has to be created manaully in the Release tests.

Signed-off-by: Johnny Bieren <[email protected]>
  • Loading branch information
johnbieren committed Feb 20, 2024
1 parent 81d6508 commit 5edf337
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
10 changes: 4 additions & 6 deletions tests/release/pipelines/push_to_external_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ var _ = framework.ReleasePipelinesSuiteDescribe("Push to external registry", Lab
managedServiceAccount, err := fw.AsKubeAdmin.CommonController.CreateServiceAccount(releasecommon.ReleasePipelineServiceAccountDefault, managedNamespace, releasecommon.ManagednamespaceSecret, nil)
Expect(err).NotTo(HaveOccurred())

_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePipelineRoleBindingForServiceAccount(devNamespace, managedServiceAccount)
Expect(err).NotTo(HaveOccurred())
_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePipelineRoleBindingForServiceAccount(managedNamespace, managedServiceAccount)
Expect(err).NotTo(HaveOccurred())

Expand Down Expand Up @@ -84,7 +82,7 @@ var _ = framework.ReleasePipelinesSuiteDescribe("Push to external registry", Lab
"mapping": map[string]interface{}{
"components": []map[string]interface{}{
{
"name": component.GetName(),
"name": component.GetName(),
"repository": releasecommon.ReleasedImagePushRepo,
},
},
Expand Down Expand Up @@ -168,15 +166,15 @@ var _ = framework.ReleasePipelinesSuiteDescribe("Push to external registry", Lab
})

It("tests if the image was pushed to quay", func() {
//retrieve the component to get the latest data
//retrieve the component to get the latest data
component, err := fw.AsKubeAdmin.HasController.GetComponent(component.GetName(), devNamespace)
Expect(err).ShouldNot(HaveOccurred(), fmt.Sprintf("could not get component %s in the %s namespace", component.GetName(), devNamespace))
containerImageDigest := strings.Split(component.Spec.ContainerImage, "@")[1]

imageDigest, err := releasecommon.GetDigestWithTagInQuay(releasecommon.ReleasedImagePushRepo + ":latest")
Expect(err).ShouldNot(HaveOccurred(), fmt.Sprintf("failed while getting Digest for quay image %s with error: %+v", releasecommon.ReleasedImagePushRepo + ":latest", err))
Expect(err).ShouldNot(HaveOccurred(), fmt.Sprintf("failed while getting Digest for quay image %s with error: %+v", releasecommon.ReleasedImagePushRepo+":latest", err))
Expect(imageDigest).To(Equal(containerImageDigest))
})
})

It("verifies that a Release is marked as succeeded.", func() {
Eventually(func() error {
Expand Down
2 changes: 0 additions & 2 deletions tests/release/pipelines/rh_push_to_external_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu
managedServiceAccount, err := fw.AsKubeAdmin.CommonController.CreateServiceAccount(releaseConst.ReleasePipelineServiceAccountDefault, managedNamespace, releaseConst.ManagednamespaceSecret, nil)
Expect(err).NotTo(HaveOccurred())

_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePipelineRoleBindingForServiceAccount(devNamespace, managedServiceAccount)
Expect(err).NotTo(HaveOccurred())
_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePipelineRoleBindingForServiceAccount(managedNamespace, managedServiceAccount)
Expect(err).NotTo(HaveOccurred())

Expand Down
2 changes: 0 additions & 2 deletions tests/release/service/happy_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ var _ = framework.ReleaseServiceSuiteDescribe("Release service happy path", Labe
managedServiceAccount, err := fw.AsKubeAdmin.CommonController.CreateServiceAccount(releaseConst.ReleasePipelineServiceAccountDefault, managedNamespace, releaseConst.ManagednamespaceSecret, nil)
Expect(err).NotTo(HaveOccurred())

_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePipelineRoleBindingForServiceAccount(devNamespace, managedServiceAccount)
Expect(err).NotTo(HaveOccurred())
_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePipelineRoleBindingForServiceAccount(managedNamespace, managedServiceAccount)
Expect(err).NotTo(HaveOccurred())

Expand Down
2 changes: 0 additions & 2 deletions tests/release/service/happy_path_with_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ var _ = framework.ReleaseServiceSuiteDescribe("happy_path_with_deployment", Labe
managedServiceAccount, err := fw.AsKubeAdmin.CommonController.CreateServiceAccount(releaseConst.ReleasePipelineServiceAccountDefault, managedNamespace, releaseConst.ManagednamespaceSecret, nil)
Expect(err).NotTo(HaveOccurred())

_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePipelineRoleBindingForServiceAccount(devNamespace, managedServiceAccount)
Expect(err).NotTo(HaveOccurred())
_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePipelineRoleBindingForServiceAccount(managedNamespace, managedServiceAccount)
Expect(err).NotTo(HaveOccurred())

Expand Down

0 comments on commit 5edf337

Please sign in to comment.