Skip to content

Commit

Permalink
fix: nil error (#2149)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhangSetSail authored Feb 11, 2025
1 parent 0091ab9 commit d2b9c16
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions worker/gc/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ func (g *GarbageCollector) DelVolumeData(serviceGCReq model.ServiceGCTaskBody) {

// DelPvPvcByServiceID -
func (g *GarbageCollector) DelPvPvcByServiceID(serviceGCReq model.ServiceGCTaskBody) {
if g.clientset == nil {
logrus.Errorf("clientset is not initialized")
return
}

if serviceGCReq.ServiceID == "" || serviceGCReq.TenantID == "" {
logrus.Errorf("invalid ServiceGCTaskBody: ServiceID or TenantID is empty")
return
}

logrus.Infof("service_id: %s", serviceGCReq.ServiceID)
deleteOpts := metav1.DeleteOptions{}
listOpts := g.listOptionsServiceID(serviceGCReq.ServiceID)
Expand Down

0 comments on commit d2b9c16

Please sign in to comment.