fix: close helmInfo file descriptor (#16319)

This commit is contained in:
jiuker 2023-01-02 15:26:59 +08:00 committed by GitHub
parent 6a04067514
commit 62cd918061
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,7 +181,7 @@ func getHelmVersion(helmInfoFilePath string) string {
}
return ""
}
defer helmInfoFile.Close()
scanner := bufio.NewScanner(helmInfoFile)
for scanner.Scan() {
if strings.Contains(scanner.Text(), "chart=") {