add context to long running operations

This commit is contained in:
Fan Shang Xiang
2023-07-13 10:01:18 +08:00
parent 55586431bd
commit 471ab88240
12 changed files with 82 additions and 90 deletions
@@ -17,6 +17,9 @@ limitations under the License.
package main
import (
"context"
"github.com/golang/glog"
"github.com/spf13/pflag"
"k8s.io/node-problem-detector/cmd/options"
)
@@ -26,5 +29,7 @@ func main() {
npdo.AddFlags(pflag.CommandLine)
pflag.Parse()
npdInteractive(npdo)
if err := npdMain(context.Background(), npdo); err != nil {
glog.Fatalf("Problem detector failed with error: %v", err)
}
}