Ignore deprecation warnings with //nolint:staticcheck

This commit is contained in:
Hanna Lee 2021-07-15 14:51:31 -04:00 committed by Antonio Ojea
parent 979c4254eb
commit 0f3836dcc5
5 changed files with 7 additions and 0 deletions

View File

@ -624,6 +624,7 @@ func serveMetrics(bindAddress, proxyMode string, enableProfiling bool, errCh cha
})
//lint:ignore SA1019 See the Metrics Stability Migration KEP
//nolint:staticcheck
proxyMux.Handle("/metrics", legacyregistry.Handler())
if enableProfiling {

View File

@ -45,6 +45,7 @@ type Config struct {
DynInformerFactory dynamicinformer.DynamicSharedInformerFactory
//lint:ignore SA1019 this deprecated field still needs to be used for now. It will be removed once the migration is done.
//nolint:staticcheck
EventBroadcaster events.EventBroadcasterAdapter
// LeaderElection is optional.

View File

@ -182,6 +182,7 @@ func (ds *dockerService) CreateContainer(_ context.Context, r *runtimeapi.Create
hc.Resources.Devices = devices
//lint:ignore SA1019 backwards compatibility
//nolint:staticcheck
securityOpts, err := ds.getSecurityOpts(config.GetLinux().GetSecurityContext().GetSeccompProfilePath(), securityOptSeparator)
if err != nil {
return nil, fmt.Errorf("failed to generate security options for container %q: %v", config.Metadata.Name, err)

View File

@ -354,6 +354,7 @@ func (s *Server) InstallDefaultHandlers() {
s.addMetricsBucketMatcher("metrics/probes")
s.addMetricsBucketMatcher("metrics/resource")
//lint:ignore SA1019 https://github.com/kubernetes/enhancements/issues/1206
//nolint:staticcheck
s.restfulCont.Handle(metricsPath, legacyregistry.Handler())
// cAdvisor metrics are exposed under the secured handler as well

View File

@ -254,8 +254,10 @@ func ShouldDeleteNamespaceDuringUpdate(ctx context.Context, key string, obj, exi
func shouldHaveOrphanFinalizer(options *metav1.DeleteOptions, haveOrphanFinalizer bool) bool {
//lint:ignore SA1019 backwards compatibility
//nolint:staticcheck
if options.OrphanDependents != nil {
//lint:ignore SA1019 backwards compatibility
//nolint:staticcheck
return *options.OrphanDependents
}
if options.PropagationPolicy != nil {
@ -266,6 +268,7 @@ func shouldHaveOrphanFinalizer(options *metav1.DeleteOptions, haveOrphanFinalize
func shouldHaveDeleteDependentsFinalizer(options *metav1.DeleteOptions, haveDeleteDependentsFinalizer bool) bool {
//lint:ignore SA1019 backwards compatibility
//nolint:staticcheck
if options.OrphanDependents != nil {
//lint:ignore SA1019 backwards compatibility
return *options.OrphanDependents == false