Skip to content

Commit 6fe737a

Browse files
committed
chore: address cache client review feedback
Signed-off-by: CAICAIIs <3360776475@qq.com>
1 parent 63f0a6c commit 6fe737a

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

pkg/ddc/cache/engine/status.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (e *CacheEngine) setWorkerComponentStatus(componentValue *common.CacheRunti
7272

7373
return ready, err
7474
}
75-
func (e *CacheEngine) setClientComponentStatus(componentValue *common.CacheRuntimeComponentValue, status *fluidapi.CacheRuntimeStatus) (ready bool, err error) {
75+
func (e *CacheEngine) setClientComponentStatus(componentValue *common.CacheRuntimeComponentValue, status *fluidapi.CacheRuntimeStatus) (fullyReady bool, err error) {
7676
manager := component.NewComponentHelper(componentValue.WorkloadType, e.Scheme, e.Client)
7777

7878
clientStatus, err := manager.ConstructComponentStatus(context.TODO(), componentValue)
@@ -81,22 +81,22 @@ func (e *CacheEngine) setClientComponentStatus(componentValue *common.CacheRunti
8181
}
8282
if clientStatus.DesiredReplicas > 0 && clientStatus.ReadyReplicas >= clientStatus.DesiredReplicas {
8383
clientStatus.Phase = fluidapi.RuntimePhaseReady
84-
ready = true
84+
fullyReady = true
8585
} else if clientStatus.ReadyReplicas > 0 {
8686
clientStatus.Phase = fluidapi.RuntimePhasePartialReady
8787
} else {
8888
clientStatus.Phase = fluidapi.RuntimePhaseNotReady
8989
}
9090
status.Client = clientStatus
9191

92-
return ready, nil
92+
return fullyReady, nil
9393
}
9494
func (e *CacheEngine) CheckAndUpdateRuntimeStatus(value *common.CacheRuntimeValue) (bool, error) {
9595
runtimeReady := false
9696

9797
err := retry.RetryOnConflict(retry.DefaultBackoff, func() error {
9898
// Reset readiness on each retry to avoid stale state after conflicts.
99-
masterReady, workerReady, clientFullyReady := true, true, true
99+
masterReady, workerReady, clientFullyReady := true, true, false
100100
runtimeReady = false
101101

102102
runtime, err := e.getRuntime()

pkg/ddc/cache/engine/status_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func TestCheckAndUpdateRuntimeStatusClientPartialReadyDoesNotBlockRuntimeReady(t
103103
}
104104
}
105105

106-
func TestCheckAndUpdateRuntimeStatusClientZeroDesiredReplicasStayNotReady(t *testing.T) {
106+
func TestCheckAndUpdateRuntimeStatusClientZeroDesiredReplicasReportsNotReady(t *testing.T) {
107107
engine, client := newStatusTestEngineWithClient(
108108
t,
109109
fake.NewFakeClientWithScheme(

0 commit comments

Comments
 (0)