Skip to content

Commit

Permalink
Merge pull request #430 from netgroup-polito/gbf/fix_tenant
Browse files Browse the repository at this point in the history
  • Loading branch information
kingmakerbot authored Mar 17, 2021
2 parents f89f6c2 + 8ccf2a8 commit bba761f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions operators/pkg/tenant-controller/tenant_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ func (r *TenantReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
return ctrl.Result{}, client.IgnoreNotFound(err)
}

if tn.Labels[r.TargetLabelKey] != r.TargetLabelValue {
// if entered here it means that is in the reconcile
// which has been requed after
// the last successful one with the old target label
return ctrl.Result{}, nil
}

var retrigErr error = nil
if tn.Status.Subscriptions == nil {
// make initial len is 2 (keycloak and nextcloud)
Expand Down
7 changes: 7 additions & 0 deletions operators/pkg/tenant-controller/workspace_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ func (r *WorkspaceReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
return ctrl.Result{}, client.IgnoreNotFound(err)
}

if ws.Labels[r.TargetLabelKey] != r.TargetLabelValue {
// if entered here it means that is in the reconcile
// which has been requed after
// the last successful one with the old target label
return ctrl.Result{}, nil
}

var retrigErr error = nil
if !ws.ObjectMeta.DeletionTimestamp.IsZero() {
klog.Infof("Processing deletion of workspace %s", ws.Name)
Expand Down

0 comments on commit bba761f

Please sign in to comment.