@@ -66,14 +66,13 @@ func (i *arrayFlags) Set(value string) error {
6666}
6767
6868var (
69- namespace = flag .String ("namespace" , os .Getenv ("NAMESPACE" ), "kubernetes namespace" )
70- timeout = flag .Duration ("timeout" , time .Second * 30 , "execution timeout" )
71- deleteNamespace = flag .Bool ("delete_namespace" , false , "delete namespace as part of the cleanup" )
72- pfconfig = portForwardConf {services : make (map [string ][]uint16 )}
73- kubeconfig string
74- waitForApps arrayFlags
75- allowErrors bool
76- disablePodLogs bool
69+ namespace = flag .String ("namespace" , os .Getenv ("NAMESPACE" ), "kubernetes namespace" )
70+ timeout = flag .Duration ("timeout" , time .Second * 30 , "execution timeout" )
71+ pfconfig = portForwardConf {services : make (map [string ][]uint16 )}
72+ kubeconfig string
73+ waitForApps arrayFlags
74+ allowErrors bool
75+ disablePodLogs bool
7776)
7877
7978func init () {
@@ -329,17 +328,6 @@ func portForward(ctx context.Context, clientset *kubernetes.Clientset, config *r
329328 return nil
330329}
331330
332- func cleanup (clientset * kubernetes.Clientset ) {
333- log .Print ("Cleanup" )
334- if * deleteNamespace && * namespace != "" {
335- log .Printf ("deleting namespace %s" , * namespace )
336- s := meta_v1 .DeletePropagationBackground
337- if err := clientset .CoreV1 ().Namespaces ().Delete (context .Background (), * namespace , meta_v1.DeleteOptions {PropagationPolicy : & s }); err != nil {
338- log .Printf ("Unable to delete namespace %s: %v" , * namespace , err )
339- }
340- }
341- }
342-
343331var ErrTimedOut = errors .New ("timed out" )
344332var ErrStdinClosed = errors .New ("stdin closed" )
345333var ErrTermSignalReceived = errors .New ("TERM signal received" )
@@ -382,7 +370,6 @@ func main() {
382370 log .Fatal (err )
383371 }
384372 clientset = kubernetes .NewForConfigOrDie (config )
385- defer cleanup (clientset )
386373
387374 go func () {
388375 err := stern .Run (ctx , * namespace , clientset , allowErrors , disablePodLogs )
0 commit comments