mirror of
https://github.com/niusmallnan/steve.git
synced 2025-08-12 02:31:37 +00:00
K-EXPLORER: delete clusterrole when dashboard shell pod is deleted
refer to #cnrancher/pandaria/issues/2179
This commit is contained in:
parent
591cb7816f
commit
d493afc3db
@ -28,7 +28,7 @@ var (
|
||||
)
|
||||
|
||||
const (
|
||||
shellPodImage = "rancher/shell:v0.1.6"
|
||||
shellPodImage = "rancher/shell:v0.1.18-rc8"
|
||||
shellPodNS = "kube-system"
|
||||
)
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user