Skip to content

Commit

Permalink
[RHTAPBUGS-322] Properly update SEB status (#362)
Browse files Browse the repository at this point in the history
* [RHTAPBUGS-322] Properly update SEB status

Signed-off-by: John Collier <[email protected]>

* Fix

Signed-off-by: John Collier <[email protected]>

* Address review comments

Signed-off-by: John Collier <[email protected]>

---------

Signed-off-by: John Collier <[email protected]>
  • Loading branch information
johnmcollier authored Jul 11, 2023
1 parent d615f43 commit 9d879ea
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions controllers/applicationsnapshotenvironmentbinding_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ func (r *SnapshotEnvironmentBindingReconciler) Reconcile(ctx context.Context, re
var tempDir string
clone := true

appSnapshotEnvBinding.Status.Components = []appstudiov1alpha1.BindingComponentStatus{}
for _, component := range components {
componentName := component.Name

Expand Down Expand Up @@ -385,7 +384,17 @@ func (r *SnapshotEnvironmentBindingReconciler) Reconcile(ctx context.Context, re
componentStatus.GitOpsRepository.GeneratedResources = componentGeneratedResources[componentName]
}

appSnapshotEnvBinding.Status.Components = append(appSnapshotEnvBinding.Status.Components, componentStatus)
isNewComponent := true
for i := range appSnapshotEnvBinding.Status.Components {
if appSnapshotEnvBinding.Status.Components[i].Name == componentStatus.Name {
appSnapshotEnvBinding.Status.Components[i] = componentStatus
isNewComponent = false
break
}
}
if isNewComponent {
appSnapshotEnvBinding.Status.Components = append(appSnapshotEnvBinding.Status.Components, componentStatus)
}

// Set the clone to false, since we dont want to clone the repo again for the other components
clone = false
Expand Down

0 comments on commit 9d879ea

Please sign in to comment.