Skip to content

Commit e592a65

Browse files
authored
Merge pull request #605 from nixpanic/automaxprocs
Add `-automaxprocs` flag for configuring `GOMAXPROCS`
2 parents 53ef661 + 85792bb commit e592a65

File tree

19 files changed

+1188
-12
lines changed

19 files changed

+1188
-12
lines changed

cmd/hostpathplugin/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
"github.com/container-storage-interface/spec/lib/go/csi"
3131
"github.com/kubernetes-csi/csi-driver-host-path/internal/proxy"
3232
"github.com/kubernetes-csi/csi-driver-host-path/pkg/hostpath"
33+
"github.com/kubernetes-csi/csi-lib-utils/standardflags"
3334
)
3435

3536
var (
@@ -71,6 +72,11 @@ func main() {
7172
// for proxying incoming calls to the embedded mock CSI driver.
7273
proxyEndpoint := flag.String("proxy-endpoint", "", "Instead of running the CSI driver code, just proxy connections from csiEndpoint to the given listening socket.")
7374

75+
standardflags.AddAutomaxprocs(func(format string, args ...any) {
76+
// wrapping fmt.Printf and ignoring its return values
77+
fmt.Printf(format, args...)
78+
})
79+
7480
klog.InitFlags(nil)
7581
flag.Parse()
7682

go.mod

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ toolchain go1.24.3
66

77
require (
88
github.com/container-storage-interface/spec v1.11.0
9-
github.com/kubernetes-csi/csi-lib-utils v0.20.0
9+
github.com/kubernetes-csi/csi-lib-utils v0.22.0
1010
github.com/pborman/uuid v1.2.1
1111
github.com/stretchr/testify v1.10.0
1212
golang.org/x/net v0.38.0
1313
google.golang.org/grpc v1.69.0
1414
google.golang.org/protobuf v1.36.5
15-
k8s.io/apimachinery v0.33.0
15+
k8s.io/apimachinery v0.33.1
1616
k8s.io/klog/v2 v2.130.1
1717
k8s.io/kubernetes v1.33.0
1818
k8s.io/utils v0.0.0-20241210054802-24370beab758
@@ -38,15 +38,16 @@ require (
3838
github.com/x448/float16 v0.8.4 // indirect
3939
go.opentelemetry.io/otel v1.33.0 // indirect
4040
go.opentelemetry.io/otel/trace v1.33.0 // indirect
41+
go.uber.org/automaxprocs v1.6.0 // indirect
4142
golang.org/x/sys v0.31.0 // indirect
4243
golang.org/x/text v0.23.0 // indirect
4344
google.golang.org/genproto/googleapis/rpc v0.0.0-20241216192217-9240e9c98484 // indirect
4445
gopkg.in/inf.v0 v0.9.1 // indirect
4546
gopkg.in/yaml.v3 v3.0.1 // indirect
4647
k8s.io/apiextensions-apiserver v0.33.0 // indirect
4748
k8s.io/apiserver v0.33.0 // indirect
48-
k8s.io/client-go v0.33.0 // indirect
49-
k8s.io/component-base v0.33.0 // indirect
49+
k8s.io/client-go v0.33.1 // indirect
50+
k8s.io/component-base v0.33.1 // indirect
5051
k8s.io/controller-manager v0.33.0 // indirect
5152
k8s.io/mount-utils v0.33.0 // indirect
5253
sigs.k8s.io/yaml v1.4.0 // indirect

go.sum

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
3232
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
3333
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
3434
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
35-
github.com/kubernetes-csi/csi-lib-utils v0.20.0 h1:JTvHRJugn+cByMnIU4nCnqPqOOUhuPzhlLqRvenwjDA=
36-
github.com/kubernetes-csi/csi-lib-utils v0.20.0/go.mod h1:3b/HFVURW11oxV/gUAKyhhkvFpxXO/zRdvh1wdEfCZY=
35+
github.com/kubernetes-csi/csi-lib-utils v0.22.0 h1:EUAs1+uHGps3OtVj4XVx16urhpI02eu+Z8Vps6plpHY=
36+
github.com/kubernetes-csi/csi-lib-utils v0.22.0/go.mod h1:f+PalKyS4Ujsjb9+m6Rj0W6c28y3nfea3paQ/VqjI28=
3737
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
3838
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
3939
github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg=
@@ -44,6 +44,8 @@ github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw=
4444
github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
4545
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
4646
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
47+
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
48+
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
4749
github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q=
4850
github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0=
4951
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
@@ -74,6 +76,8 @@ go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4Jjx
7476
go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8=
7577
go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s=
7678
go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck=
79+
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
80+
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
7781
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
7882
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
7983
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=

vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/protosanitizer.go

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/kubernetes-csi/csi-lib-utils/standardflags/automaxprocs.go

Lines changed: 105 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/go.uber.org/automaxprocs/LICENSE

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/go.uber.org/automaxprocs/internal/cgroups/cgroup.go

Lines changed: 79 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)