diff --git a/pkg/resources/cluster/cluster.go b/pkg/resources/cluster/cluster.go index cfb6706..ea02af7 100644 --- a/pkg/resources/cluster/cluster.go +++ b/pkg/resources/cluster/cluster.go @@ -28,7 +28,7 @@ var ( ) const ( - shellPodImage = "rancher/shell:v0.1.6" + shellPodImage = "rancher/shell:v0.1.18-rc8" shellPodNS = "kube-system" ) diff --git a/pkg/resources/cluster/shell.go b/pkg/resources/cluster/shell.go index 0f27865..d71e4a6 100644 --- a/pkg/resources/cluster/shell.go +++ b/pkg/resources/cluster/shell.go @@ -42,7 +42,8 @@ func (s *shell) ServeHTTP(rw http.ResponseWriter, req *http.Request) { defer func() { ctx, cancel := context.WithTimeout(context.Background(), time.Second*30) defer cancel() - _ = client.CoreV1().Pods(pod.Namespace).Delete(ctx, pod.Name, metav1.DeleteOptions{}) + client.CoreV1().Pods(pod.Namespace).Delete(ctx, pod.Name, metav1.DeleteOptions{}) + s.impersonator.DeleteRole(ctx, *pod) }() s.proxyRequest(rw, req, pod, client) }