Skip to content

Commit

Permalink
fix: dynamic buffer size to prevent cut off
Browse files Browse the repository at this point in the history
  • Loading branch information
Karim-W committed Aug 27, 2024
1 parent ee6ac72 commit 0a98056
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion service/kubesecretes.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,14 @@ func modifyKubeSecret(namespace, secret, format string) {

defer file.Close()

size, err := file.Stat()
if err != nil {
println(err.Error())
return
}

// read file whole
byts := make([]byte, 1024)
byts := make([]byte, size.Size())
n, err := file.Read(byts)
if err != nil {
println(err.Error())
Expand All @@ -373,6 +379,7 @@ func modifyKubeSecret(namespace, secret, format string) {
}

if err != nil {
fmt.Println("bytssss", string(byts))
println(err.Error())
return
}
Expand Down

0 comments on commit 0a98056

Please sign in to comment.