Skip to content

Commit 9752d8c

Browse files
authored
[ISSUE #216] support console resource update (#217)
1 parent 0ccad32 commit 9752d8c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pkg/controller/console/console_controller.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,17 @@ func (r *ReconcileConsole) Reconcile(ctx context.Context, request reconcile.Requ
161161
return reconcile.Result{}, err
162162
}
163163

164-
// Support console deployment scaling
165-
if !reflect.DeepEqual(instance.Spec.ConsoleDeployment.Spec.Replicas, found.Spec.Replicas) {
164+
// Support console deployment update
165+
if !reflect.DeepEqual(instance.Spec.ConsoleDeployment.Spec.Replicas, found.Spec.Replicas) ||
166+
!reflect.DeepEqual(instance.Spec.ConsoleDeployment.Spec.Template.Spec.Containers[0].Resources, found.Spec.Template.Spec.Containers[0].Resources) {
167+
166168
found.Spec.Replicas = instance.Spec.ConsoleDeployment.Spec.Replicas
169+
found.Spec.Template.Spec.Containers[0].Resources = instance.Spec.ConsoleDeployment.Spec.Template.Spec.Containers[0].Resources
167170
err = r.client.Update(context.TODO(), found)
168171
if err != nil {
169-
reqLogger.Error(err, "Failed to update console CR ", "Namespace", found.Namespace, "Name", found.Name)
172+
reqLogger.Error(err, "Failed to update console CR", "Namespace", found.Namespace, "Name", found.Name)
170173
} else {
171-
reqLogger.Info("Successfully updated console CR ", "Namespace", found.Namespace, "Name", found.Name)
174+
reqLogger.Info("Successfully updated console CR", "Namespace", found.Namespace, "Name", found.Name)
172175
}
173176
}
174177

0 commit comments

Comments
 (0)