INNER CODE UNIT · Go
run
cri-o/cri-o · contrib/metrics-exporter/main.go:32
func run() error {
logrus.SetFormatter(&logrus.TextFormatter{DisableTimestamp: true})
logrus.Info("Getting cluster configuration")
config, err := rest.InClusterConfig()
if err != nil {
return fmt.Errorf("retrieving client config: %w", err)
}
logrus.Info("Creating Kubernetes client")
clientset, err := kubernetes.NewForConfig(config)
if err != nil {
return fmt.Errorf("creating Kubernetes client: %w", err)
}
logrus.Info("Retrieving nodes")