Skip to content

Commit

Permalink
increase wait time for configmap to sync before reload
Browse files Browse the repository at this point in the history
Signed-off-by: zufardhiyaulhaq <zufardhiyaulhaq@gmail.com>
  • Loading branch information
zufardhiyaulhaq committed Jun 12, 2022
1 parent 6aa71a9 commit 7719678
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions controllers/client_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,6 @@ func (r *ClientReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
}

log.Info("compare configmap")
configmap, err = builder.NewConfigMapBuilder().
SetConfig(configuration).
SetName(client.Name).
SetNamespace(client.Namespace).
Build()
if err != nil {
return ctrl.Result{}, err
}

if !reflect.DeepEqual(createdConfigMap.Data, configmap.Data) {
log.Info("found config diff, update configmap")

Expand All @@ -200,7 +191,9 @@ func (r *ClientReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
return ctrl.Result{}, err
}

time.Sleep(10 * time.Second)
// TODO: need to figure out how to make sure configmap is sync in the pod rather than implementing sleep
time.Sleep(120 * time.Second)

log.Info("reload config")
config.Common.AdminAddress = service.Name + "." + service.Namespace + ".svc"
err = handler.Reload(config)
Expand Down

0 comments on commit 7719678

Please sign in to comment.