@@ -48,8 +48,7 @@ func (d *DeleteAndReAddLabels) Run() error {
48
48
return fmt .Errorf ("error creating Kubernetes client: %w" , err )
49
49
}
50
50
51
- ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
52
- defer cancel ()
51
+ ctx := context .TODO ()
53
52
54
53
labelsToDelete := `"shared-lab-00000": null, "shared-lab-00001": null, "shared-lab-00002": null`
55
54
labelsToAdd := `"shared-lab-00000": "val", "shared-lab-00001": "val", "shared-lab-00002": "val"`
@@ -74,9 +73,6 @@ func (d *DeleteAndReAddLabels) Run() error {
74
73
75
74
patch := fmt .Sprintf (`{"metadata": {"labels": {%s}}}` , labelsToDelete )
76
75
77
- ctx , cancel = contextToLabelAllPods ()
78
- defer cancel ()
79
-
80
76
err = d .deleteLabels (ctx , clientset , pods , patch )
81
77
if err != nil {
82
78
return fmt .Errorf ("error deleting labels: %w" , err )
@@ -89,9 +85,6 @@ func (d *DeleteAndReAddLabels) Run() error {
89
85
90
86
patch = fmt .Sprintf (`{"metadata": {"labels": {%s}}}` , labelsToAdd )
91
87
92
- ctx , cancel = contextToLabelAllPods ()
93
- defer cancel ()
94
-
95
88
err = d .addLabels (ctx , clientset , pods , patch )
96
89
if err != nil {
97
90
return fmt .Errorf ("error adding labels: %w" , err )
0 commit comments