Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed tenant operator target label behavior #430

Merged
merged 1 commit into from
Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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