Skip to content

Commit

Permalink
chore: add configuration cr lifecycle (#5600)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophon-zt committed Oct 25, 2023
1 parent 2fa8cc0 commit 5fbe5dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions controllers/apps/configuration/configuration_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log"

appsv1alpha1 "github.com/apecloud/kubeblocks/apis/apps/v1alpha1"
"github.com/apecloud/kubeblocks/pkg/constant"
"github.com/apecloud/kubeblocks/pkg/controller/component"
intctrlutil "github.com/apecloud/kubeblocks/pkg/controllerutil"
)
Expand Down Expand Up @@ -73,6 +74,10 @@ func (r *ConfigurationReconciler) Reconcile(ctx context.Context, req ctrl.Reques
return intctrlutil.CheckedRequeueWithError(err, reqCtx.Log, "cannot find configuration")
}

if res, err := intctrlutil.HandleCRDeletion(reqCtx, r, configuration, constant.ConfigurationTemplateFinalizerName, nil); res != nil {
return *res, err
}

tasks := make([]Task, 0, len(configuration.Spec.ConfigItemDetails))
for _, item := range configuration.Spec.ConfigItemDetails {
if status := fromItemStatus(reqCtx, &configuration.Status, item); status != nil {
Expand Down

0 comments on commit 5fbe5dd

Please sign in to comment.