1
0
mirror of https://github.com/ko-build/ko.git synced 2025-07-12 23:50:31 +02:00

use automaxprocs to calculate the number of CPUs (#649)

this is  useful for container environments
This commit is contained in:
Dave Protasowski
2022-03-14 15:25:02 -04:00
committed by GitHub
parent c6e07e89e7
commit 3cf55a10c9
16 changed files with 834 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import (
cranecmd "github.com/google/go-containerregistry/cmd/crane/cmd"
"github.com/google/go-containerregistry/pkg/logs"
"github.com/spf13/cobra"
"go.uber.org/automaxprocs/maxprocs"
)
var Root = New()
@ -37,6 +38,8 @@ func New() *cobra.Command {
logs.Debug.SetOutput(os.Stderr)
}
logs.Progress.SetOutput(os.Stderr)
maxprocs.Set(maxprocs.Logger(logs.Debug.Printf))
},
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()