Skip to content

Commit

Permalink
Merge pull request #116902 from sourcelliu/cast
Browse files Browse the repository at this point in the history
Remove unnecessary int type conversion
  • Loading branch information
k8s-ci-robot committed Apr 21, 2023
2 parents 9d34ca5 + 3b7c14e commit 7fe63a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kubelet/kuberuntime/kuberuntime_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ func calcRestartCountByLogDir(path string) (int, error) {
if _, err := os.Stat(path); err != nil {
return 0, nil
}
restartCount := int(0)
files, err := os.ReadDir(path)
if err != nil {
return 0, err
}
if len(files) == 0 {
return 0, nil
}
restartCount := 0
restartCountLogFileRegex := regexp.MustCompile(`^(\d+)\.log(\..*)?`)
for _, file := range files {
if file.IsDir() {
Expand Down

0 comments on commit 7fe63a9

Please sign in to comment.