Merge pull request #109407 from yxxhero/remove_unused_code_in_kubelet

Clean up unused code in kubelet
This commit is contained in:
Kubernetes Prow Robot 2022-06-27 19:16:08 -07:00 committed by GitHub
commit c7eb5a49ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,14 +22,12 @@ limitations under the License.
package main package main
import ( import (
"math/rand"
"os" "os"
"time"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/component-base/cli"
cliflag "k8s.io/component-base/cli/flag" cliflag "k8s.io/component-base/cli/flag"
"k8s.io/component-base/logs"
_ "k8s.io/component-base/logs/json/register" // for JSON log format registration _ "k8s.io/component-base/logs/json/register" // for JSON log format registration
_ "k8s.io/component-base/metrics/prometheus/restclient" _ "k8s.io/component-base/metrics/prometheus/restclient"
_ "k8s.io/component-base/metrics/prometheus/version" // for version metric registration _ "k8s.io/component-base/metrics/prometheus/version" // for version metric registration
@ -48,12 +46,6 @@ func main() {
} }
func run(command *cobra.Command) int { func run(command *cobra.Command) int {
defer logs.FlushLogs()
rand.Seed(time.Now().UnixNano())
command.SetGlobalNormalizationFunc(cliflag.WordSepNormalizeFunc) command.SetGlobalNormalizationFunc(cliflag.WordSepNormalizeFunc)
if err := command.Execute(); err != nil { return cli.Run(command)
return 1
}
return 0
} }