mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-12-24 11:51:13 +08:00
refactor: refactor code and fix ut (#709)
* feat: ut (#707) * feat: ut (#708)
This commit is contained in:
@@ -122,6 +122,8 @@ func (d *SyncOptions) DoSync(ctx context.Context, kubeconfigJsonBytes []byte, im
|
||||
"origin-workload": originName,
|
||||
}
|
||||
u.SetLabels(labels.Merge(u.GetLabels(), labelsMap))
|
||||
// for leave resource and disconnect from cluster
|
||||
u.SetDeletionGracePeriodSeconds(ptr.To[int64](60))
|
||||
var path []string
|
||||
var spec *v1.PodTemplateSpec
|
||||
spec, path, err = util.GetPodTemplateSpecPath(u)
|
||||
@@ -489,6 +491,13 @@ func (d *SyncOptions) Cleanup(ctx context.Context, workloads ...string) error {
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, workload := range d.Workloads {
|
||||
plog.G(ctx).Infof("Wait workload %s", workload)
|
||||
err := util.RolloutStatus(ctx, d.factory, d.Namespace, workload, time.Minute*60)
|
||||
if err != nil {
|
||||
plog.G(ctx).Warnf("Failed to rollback workload %s: %v", workload, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user