-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add verify script to detect dead code #8663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adrianmoisey The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I know this is going to be annoying, but is there any way we could put this in the root $ GOLDFLAGS=-dumpdep go build -C cluster-autoscaler -ldflags=-dumpdep -o cluster-autoscaler 2>&1 | grep "\->" | /Users/jackfrancis/go/bin/whydeadcode
text/template.(*state).evalField reachable from:
text/template.(*state).evalFieldChain
text/template.(*state).evalCommand
text/template.(*state).evalPipeline
text/template.(*state).walk
text/template.(*Template).execute
html/template.(*Template).Execute
golang.org/x/net/trace.RenderEvents
golang.org/x/net/trace.Events
golang.org/x/net/trace.Events·f
golang.org/x/net/trace.init.0
golang.org/x/net/trace..inittask
go:main.inittasks
_
k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.(*addressableValue).Method reachable from:
type:k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.addressableValue
type:func(k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.MarshalOptions, *k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.Encoder, k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.addressableValue) error
type:k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.typedArshaler[k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.MarshalOptions,k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.Encoder]
type:[]k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.typedArshaler[k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.MarshalOptions,k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.Encoder]
type:k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.typedArshalers[k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.MarshalOptions,k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.Encoder]
type:*k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.typedArshalers[k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.MarshalOptions,k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.Encoder]
type:k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.MarshalOptions
type:func(k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.MarshalOptions, *k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.Encoder) error
type:k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.MarshalerV2
type:*k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.MarshalerV2
k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json.init
k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json..inittask
go:main.inittasks
_
github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/meta.(*ServiceInfo).Methods reachable from:
type:*github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/meta.ServiceInfo
github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/meta.init.0
github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/meta..inittask
go:main.inittasks
_
github.com/google/go-cmp/cmp/internal/value.appendTypeName reachable from:
github.com/google/go-cmp/cmp.formatOptions.FormatType
github.com/google/go-cmp/cmp.formatOptions.FormatDiff
github.com/google/go-cmp/cmp.(*defaultReporter).String
github.com/google/go-cmp/cmp.Diff
k8s.io/cloud-provider-gcp/providers/gce.(*Cloud).ensureInternalLoadBalancer
k8s.io/cloud-provider-gcp/providers/gce.(*Cloud).EnsureLoadBalancer
type:*k8s.io/cloud-provider-gcp/providers/gce.Cloud
type:k8s.io/cloud-provider-gcp/providers/gce.Cloud
k8s.io/cloud-provider-gcp/providers/gce.CreateGCECloud
k8s.io/cloud-provider-gcp/providers/gce.newGCECloud
k8s.io/cloud-provider-gcp/providers/gce.init.0.func1
k8s.io/cloud-provider-gcp/providers/gce.init.0.func1·f
k8s.io/cloud-provider-gcp/providers/gce.init.0
k8s.io/cloud-provider-gcp/providers/gce..inittask
go:main.inittasks
_ |
My preference is to not do that, since the VPA and CA operate quite differently (ie: VPA has 3 binaries). |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Dead code causes the outputted Go binary to be larger. Upstream kubernetes recently put effort into ensuring that Kubernetes doesn't include dead code.
We should copy this, if reasonable to do so, to save storage and bandwidth costs.
Which issue(s) this PR fixes:
Fixes #8270
Special notes for your reviewer:
I've modified the verify script to run all
verify-.sh
scripts for the VPA. It seems that the codegen hasn't been run in a while, which I'll fix in another PRDoes this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: