Skip to content

Commit

Permalink
feat(RHTAPREL-833): remove environment from RPA creation
Browse files Browse the repository at this point in the history
Signed-off-by: Jing Qi <[email protected]>
  • Loading branch information
jinqi7 committed Feb 27, 2024
1 parent e5c98cd commit 00098bc
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 23 deletions.
3 changes: 1 addition & 2 deletions pkg/clients/release/plans.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (r *ReleaseController) CreateReleasePlan(name, namespace, application, targ
}

// CreateReleasePlanAdmission creates a new ReleasePlanAdmission using the given parameters.
func (r *ReleaseController) CreateReleasePlanAdmission(name, namespace, environment, origin, policy, serviceAccount string, applications []string, autoRelease bool, pipelineRef *utils.PipelineRef, data *runtime.RawExtension) (*releaseApi.ReleasePlanAdmission, error) {
func (r *ReleaseController) CreateReleasePlanAdmission(name, namespace, origin, policy, serviceAccount string, applications []string, autoRelease bool, pipelineRef *utils.PipelineRef, data *runtime.RawExtension) (*releaseApi.ReleasePlanAdmission, error) {
releasePlanAdmission := &releaseApi.ReleasePlanAdmission{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Expand All @@ -53,7 +53,6 @@ func (r *ReleaseController) CreateReleasePlanAdmission(name, namespace, environm
Spec: releaseApi.ReleasePlanAdmissionSpec{
Applications: applications,
Data: data,
Environment: environment,
Origin: origin,
Pipeline: &utils.Pipeline{
PipelineRef: *pipelineRef,
Expand Down
2 changes: 1 addition & 1 deletion tests/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,7 @@ var _ = framework.BuildSuiteDescribe("Build service E2E tests", Label("build", "

GinkgoWriter.Printf("ReleaseAdmissionPlan data: %s", string(rawData))
Expect(err).NotTo(HaveOccurred())
_, err = f.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission("demo", managedNamespace, "", f.UserNamespace, "demo", constants.DefaultPipelineServiceAccount, []string{applicationName}, false, &tektonutils.PipelineRef{
_, err = f.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission("demo", managedNamespace, f.UserNamespace, "demo", constants.DefaultPipelineServiceAccount, []string{applicationName}, false, &tektonutils.PipelineRef{
Resolver: "git",
Params: []tektonutils.Param{
{Name: "url", Value: releasecommon.RelSvcCatalogURL},
Expand Down
2 changes: 1 addition & 1 deletion tests/release/pipelines/fbc_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ func createFBCReleasePlanAdmission(fbcRPAName string, managedFw framework.Framew
})
Expect(err).NotTo(HaveOccurred())

_, err = managedFw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(fbcRPAName, managedNamespace, "", devNamespace, fbcECPName, fbcServiceAccountName, []string{fbcAppName}, true, &tektonutils.PipelineRef{
_, err = managedFw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(fbcRPAName, managedNamespace, devNamespace, fbcECPName, fbcServiceAccountName, []string{fbcAppName}, true, &tektonutils.PipelineRef{
Resolver: "git",
Params: []tektonutils.Param{
{Name: "url", Value: releasecommon.RelSvcCatalogURL},
Expand Down
2 changes: 1 addition & 1 deletion tests/release/pipelines/push_to_external_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ var _ = framework.ReleasePipelinesSuiteDescribe("Push to external registry", Lab
})
Expect(err).NotTo(HaveOccurred())

_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(releasecommon.TargetReleasePlanAdmissionName, managedNamespace, "", devNamespace, releasecommon.ReleaseStrategyPolicyDefault, releasecommon.ReleasePipelineServiceAccountDefault, []string{releasecommon.ApplicationNameDefault}, true, &tektonutils.PipelineRef{
_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(releasecommon.TargetReleasePlanAdmissionName, managedNamespace, devNamespace, releasecommon.ReleaseStrategyPolicyDefault, releasecommon.ReleasePipelineServiceAccountDefault, []string{releasecommon.ApplicationNameDefault}, true, &tektonutils.PipelineRef{
Resolver: "git",
Params: []tektonutils.Param{
{Name: "url", Value: releasecommon.RelSvcCatalogURL},
Expand Down
2 changes: 1 addition & 1 deletion tests/release/pipelines/rh_push_to_external_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ var _ = framework.ReleasePipelinesSuiteDescribe("[HACBS-1571]test-release-e2e-pu
})
Expect(err).NotTo(HaveOccurred())

_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(releasecommon.TargetReleasePlanAdmissionName, managedNamespace, "", devNamespace, releasecommon.ReleaseStrategyPolicyDefault, releasecommon.ReleasePipelineServiceAccountDefault, []string{releasecommon.ApplicationNameDefault}, true, &tektonutils.PipelineRef{
_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(releasecommon.TargetReleasePlanAdmissionName, managedNamespace, devNamespace, releasecommon.ReleaseStrategyPolicyDefault, releasecommon.ReleasePipelineServiceAccountDefault, []string{releasecommon.ApplicationNameDefault}, true, &tektonutils.PipelineRef{
Resolver: "git",
Params: []tektonutils.Param{
{Name: "url", Value: releasecommon.RelSvcCatalogURL},
Expand Down
13 changes: 0 additions & 13 deletions tests/release/service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,6 @@ Checkpoints:
- The Release passes.
- Validate that the Release object is referenced by the PipelineRun.

## The happy path with deployment (happy_path_with_deployment.go)

This test is designed to test release-service functionalities with an environment defined. Once the release successfully passes, the application and components will be copied to the specified environment.

Checkpoints:
- A build PipelineRun is created in the dev namespace.
- The build PipelineRun passes.
- The Release CR is created.
- The release PipelineRun is successfully created in the managed namespace.
- The release PipelineRun is expected to pass.
- The Release passes.
- Copy the application and component to the environment and ensure the process succeeds.

## Ensure ReleasePlan has owner references set (release_plan_owner_ref.go)

This test is designed to ensure that the ReleasePlan controller reconciles ReleasePlans to have an owner reference for its application.
Expand Down
2 changes: 1 addition & 1 deletion tests/release/service/happy_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("Release service happy path", Labe
})
Expect(err).NotTo(HaveOccurred())

_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(releasecommon.TargetReleasePlanAdmissionName, managedNamespace, "", devNamespace, releasecommon.ReleaseStrategyPolicyDefault, releasecommon.ReleasePipelineServiceAccountDefault, []string{releasecommon.ApplicationNameDefault}, true, &tektonutils.PipelineRef{
_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(releasecommon.TargetReleasePlanAdmissionName, managedNamespace, devNamespace, releasecommon.ReleaseStrategyPolicyDefault, releasecommon.ReleasePipelineServiceAccountDefault, []string{releasecommon.ApplicationNameDefault}, true, &tektonutils.PipelineRef{
Resolver: "git",
Params: []tektonutils.Param{
{Name: "url", Value: releasecommon.RelSvcCatalogURL},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("[HACBS-2360] Release CR fails whe
_, err = fw.AsKubeAdmin.IntegrationController.CreateSnapshotWithComponents(snapshotName, "", releasecommon.ApplicationName, devNamespace, []v1alpha1.SnapshotComponent{})
Expect(err).NotTo(HaveOccurred())

_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(destinationReleasePlanAdmissionName, managedNamespace, "", devNamespace, releasecommon.ReleaseStrategyPolicy, constants.DefaultPipelineServiceAccount, []string{releasecommon.ApplicationName}, true, &tektonutils.PipelineRef{
_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(destinationReleasePlanAdmissionName, managedNamespace, devNamespace, releasecommon.ReleaseStrategyPolicy, constants.DefaultPipelineServiceAccount, []string{releasecommon.ApplicationName}, true, &tektonutils.PipelineRef{
Resolver: "git",
Params: []tektonutils.Param{
{Name: "url", Value: releasecommon.RelSvcCatalogURL},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var _ = framework.ReleaseServiceSuiteDescribe("ReleasePlan and ReleasePlanAdmiss
})

It("Creates ReleasePlanAdmission CR in corresponding managed namespace", func() {
_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(releasecommon.TargetReleasePlanAdmissionName, managedNamespace, "", devNamespace, releasecommon.ReleaseStrategyPolicyDefault, releasecommon.ReleasePipelineServiceAccountDefault, []string{releasecommon.ApplicationNameDefault}, true, &tektonutils.PipelineRef{
_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission(releasecommon.TargetReleasePlanAdmissionName, managedNamespace, devNamespace, releasecommon.ReleaseStrategyPolicyDefault, releasecommon.ReleasePipelineServiceAccountDefault, []string{releasecommon.ApplicationNameDefault}, true, &tektonutils.PipelineRef{
Resolver: "git",
Params: []tektonutils.Param{
{Name: "url", Value: releasecommon.RelSvcCatalogURL},
Expand Down
2 changes: 1 addition & 1 deletion tests/rhtap-demo/rhtap-demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ func createReleaseConfig(fw framework.Framework, managedNamespace, componentName
_, err = fw.AsKubeAdmin.TektonController.CreateEnterpriseContractPolicy(ecPolicyName, managedNamespace, defaultEcPolicySpec)
Expect(err).NotTo(HaveOccurred())

_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission("demo", managedNamespace, "", fw.UserNamespace, ecPolicyName, "release-service-account", []string{appName}, true, &tektonutils.PipelineRef{
_, err = fw.AsKubeAdmin.ReleaseController.CreateReleasePlanAdmission("demo", managedNamespace, fw.UserNamespace, ecPolicyName, "release-service-account", []string{appName}, true, &tektonutils.PipelineRef{
Resolver: "git",
Params: []tektonutils.Param{
{Name: "url", Value: releasecommon.RelSvcCatalogURL},
Expand Down

0 comments on commit 00098bc

Please sign in to comment.