mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-09-27 19:52:18 +08:00
hotfix: remove job before install
This commit is contained in:
@@ -58,6 +58,7 @@ func (c *ConnectOptions) Cleanup(ctx context.Context) {
|
|||||||
}
|
}
|
||||||
if c.clientset != nil {
|
if c.clientset != nil {
|
||||||
_ = c.clientset.CoreV1().Pods(c.Namespace).Delete(ctx2, config.CniNetName, v1.DeleteOptions{GracePeriodSeconds: pointer.Int64(0)})
|
_ = c.clientset.CoreV1().Pods(c.Namespace).Delete(ctx2, config.CniNetName, v1.DeleteOptions{GracePeriodSeconds: pointer.Int64(0)})
|
||||||
|
_ = c.clientset.BatchV1().Jobs(c.Namespace).Delete(ctx2, config.ConfigMapPodTrafficManager, v1.DeleteOptions{GracePeriodSeconds: pointer.Int64(0)})
|
||||||
}
|
}
|
||||||
// leave proxy resources
|
// leave proxy resources
|
||||||
err := c.LeaveAllProxyResources(ctx2)
|
err := c.LeaveAllProxyResources(ctx2)
|
||||||
|
@@ -49,6 +49,7 @@ func createOutboundPod(ctx context.Context, clientset *kubernetes.Clientset, nam
|
|||||||
_ = clientset.CoreV1().Services(namespace).Delete(ctx, name, options)
|
_ = clientset.CoreV1().Services(namespace).Delete(ctx, name, options)
|
||||||
_ = clientset.CoreV1().Secrets(namespace).Delete(ctx, name, options)
|
_ = clientset.CoreV1().Secrets(namespace).Delete(ctx, name, options)
|
||||||
_ = clientset.CoreV1().Pods(namespace).Delete(ctx, config.CniNetName, options)
|
_ = clientset.CoreV1().Pods(namespace).Delete(ctx, config.CniNetName, options)
|
||||||
|
_ = clientset.BatchV1().Jobs(namespace).Delete(ctx, name, options)
|
||||||
_ = clientset.AppsV1().Deployments(namespace).Delete(ctx, name, options)
|
_ = clientset.AppsV1().Deployments(namespace).Delete(ctx, name, options)
|
||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
|
@@ -45,7 +45,7 @@ func (c *ConnectOptions) Uninstall(ctx context.Context) error {
|
|||||||
_ = c.clientset.RbacV1().Roles(ns).Delete(ctx, name, options)
|
_ = c.clientset.RbacV1().Roles(ns).Delete(ctx, name, options)
|
||||||
_ = c.clientset.CoreV1().Services(ns).Delete(ctx, name, options)
|
_ = c.clientset.CoreV1().Services(ns).Delete(ctx, name, options)
|
||||||
_ = c.clientset.AppsV1().Deployments(ns).Delete(ctx, name, options)
|
_ = c.clientset.AppsV1().Deployments(ns).Delete(ctx, name, options)
|
||||||
|
_ = c.clientset.BatchV1().Jobs(ns).Delete(ctx, name, options)
|
||||||
_ = c.CleanupLocalContainer(ctx)
|
_ = c.CleanupLocalContainer(ctx)
|
||||||
plog.G(ctx).Info("Done")
|
plog.G(ctx).Info("Done")
|
||||||
return nil
|
return nil
|
||||||
|
Reference in New Issue
Block a user