mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Remove //lint:ignore pragmas that aren't being used anymore
This commit is contained in:
parent
a707061828
commit
07a883d8e6
@ -623,8 +623,7 @@ func serveMetrics(bindAddress, proxyMode string, enableProfiling bool, errCh cha
|
|||||||
fmt.Fprintf(w, "%s", proxyMode)
|
fmt.Fprintf(w, "%s", proxyMode)
|
||||||
})
|
})
|
||||||
|
|
||||||
//lint:ignore SA1019 See the Metrics Stability Migration KEP
|
//nolint:staticcheck // SA1019 See the Metrics Stability Migration KEP
|
||||||
//nolint:staticcheck
|
|
||||||
proxyMux.Handle("/metrics", legacyregistry.Handler())
|
proxyMux.Handle("/metrics", legacyregistry.Handler())
|
||||||
|
|
||||||
if enableProfiling {
|
if enableProfiling {
|
||||||
|
@ -44,8 +44,7 @@ type Config struct {
|
|||||||
InformerFactory informers.SharedInformerFactory
|
InformerFactory informers.SharedInformerFactory
|
||||||
DynInformerFactory dynamicinformer.DynamicSharedInformerFactory
|
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 // 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
|
EventBroadcaster events.EventBroadcasterAdapter
|
||||||
|
|
||||||
// LeaderElection is optional.
|
// LeaderElection is optional.
|
||||||
|
@ -181,8 +181,7 @@ func (ds *dockerService) CreateContainer(_ context.Context, r *runtimeapi.Create
|
|||||||
}
|
}
|
||||||
hc.Resources.Devices = devices
|
hc.Resources.Devices = devices
|
||||||
|
|
||||||
//lint:ignore SA1019 backwards compatibility
|
//nolint:staticcheck // SA1019 backwards compatibility
|
||||||
//nolint:staticcheck
|
|
||||||
securityOpts, err := ds.getSecurityOpts(config.GetLinux().GetSecurityContext().GetSeccompProfilePath(), securityOptSeparator)
|
securityOpts, err := ds.getSecurityOpts(config.GetLinux().GetSecurityContext().GetSeccompProfilePath(), securityOptSeparator)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to generate security options for container %q: %v", config.Metadata.Name, err)
|
return nil, fmt.Errorf("failed to generate security options for container %q: %v", config.Metadata.Name, err)
|
||||||
|
@ -353,8 +353,7 @@ func (s *Server) InstallDefaultHandlers() {
|
|||||||
s.addMetricsBucketMatcher("metrics/cadvisor")
|
s.addMetricsBucketMatcher("metrics/cadvisor")
|
||||||
s.addMetricsBucketMatcher("metrics/probes")
|
s.addMetricsBucketMatcher("metrics/probes")
|
||||||
s.addMetricsBucketMatcher("metrics/resource")
|
s.addMetricsBucketMatcher("metrics/resource")
|
||||||
//lint:ignore SA1019 https://github.com/kubernetes/enhancements/issues/1206
|
//nolint:staticcheck // SA1019 https://github.com/kubernetes/enhancements/issues/1206
|
||||||
//nolint:staticcheck
|
|
||||||
s.restfulCont.Handle(metricsPath, legacyregistry.Handler())
|
s.restfulCont.Handle(metricsPath, legacyregistry.Handler())
|
||||||
|
|
||||||
// cAdvisor metrics are exposed under the secured handler as well
|
// cAdvisor metrics are exposed under the secured handler as well
|
||||||
|
@ -253,11 +253,8 @@ func ShouldDeleteNamespaceDuringUpdate(ctx context.Context, key string, obj, exi
|
|||||||
}
|
}
|
||||||
|
|
||||||
func shouldHaveOrphanFinalizer(options *metav1.DeleteOptions, haveOrphanFinalizer bool) bool {
|
func shouldHaveOrphanFinalizer(options *metav1.DeleteOptions, haveOrphanFinalizer bool) bool {
|
||||||
//lint:ignore SA1019 backwards compatibility
|
//nolint:staticcheck // SA1019 backwards compatibility
|
||||||
//nolint:staticcheck
|
|
||||||
if options.OrphanDependents != nil {
|
if options.OrphanDependents != nil {
|
||||||
//lint:ignore SA1019 backwards compatibility
|
|
||||||
//nolint:staticcheck
|
|
||||||
return *options.OrphanDependents
|
return *options.OrphanDependents
|
||||||
}
|
}
|
||||||
if options.PropagationPolicy != nil {
|
if options.PropagationPolicy != nil {
|
||||||
@ -267,10 +264,8 @@ func shouldHaveOrphanFinalizer(options *metav1.DeleteOptions, haveOrphanFinalize
|
|||||||
}
|
}
|
||||||
|
|
||||||
func shouldHaveDeleteDependentsFinalizer(options *metav1.DeleteOptions, haveDeleteDependentsFinalizer bool) bool {
|
func shouldHaveDeleteDependentsFinalizer(options *metav1.DeleteOptions, haveDeleteDependentsFinalizer bool) bool {
|
||||||
//lint:ignore SA1019 backwards compatibility
|
//nolint:staticcheck // SA1019 backwards compatibility
|
||||||
//nolint:staticcheck
|
|
||||||
if options.OrphanDependents != nil {
|
if options.OrphanDependents != nil {
|
||||||
//lint:ignore SA1019 backwards compatibility
|
|
||||||
return *options.OrphanDependents == false
|
return *options.OrphanDependents == false
|
||||||
}
|
}
|
||||||
if options.PropagationPolicy != nil {
|
if options.PropagationPolicy != nil {
|
||||||
|
@ -304,8 +304,7 @@ func SupportsQuotas(m mount.Interface, path string) (bool, error) {
|
|||||||
// AssignQuota chooses the quota ID based on the pod UID and path.
|
// AssignQuota chooses the quota ID based on the pod UID and path.
|
||||||
// If the pod UID is identical to another one known, it may (but presently
|
// If the pod UID is identical to another one known, it may (but presently
|
||||||
// doesn't) choose the same quota ID as other volumes in the pod.
|
// doesn't) choose the same quota ID as other volumes in the pod.
|
||||||
//lint:ignore SA4009 poduid is overwritten by design, see comment below
|
func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resource.Quantity) error { //nolint:staticcheck // SA4009 poduid is overwritten by design, see comment below
|
||||||
func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resource.Quantity) error { //nolint:staticcheck
|
|
||||||
if bytes == nil {
|
if bytes == nil {
|
||||||
return fmt.Errorf("attempting to assign null quota to %s", path)
|
return fmt.Errorf("attempting to assign null quota to %s", path)
|
||||||
}
|
}
|
||||||
@ -320,7 +319,7 @@ func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resour
|
|||||||
// volumes in a pod, we can simply remove this line of code.
|
// volumes in a pod, we can simply remove this line of code.
|
||||||
// If and when we decide permanently that we're going to adopt
|
// If and when we decide permanently that we're going to adopt
|
||||||
// one quota per volume, we can rip all of the pod code out.
|
// one quota per volume, we can rip all of the pod code out.
|
||||||
poduid = types.UID(uuid.NewUUID()) //nolint:staticcheck
|
poduid = types.UID(uuid.NewUUID()) //nolint:staticcheck // SA4009 poduid is overwritten by design, see comment above
|
||||||
if pod, ok := dirPodMap[path]; ok && pod != poduid {
|
if pod, ok := dirPodMap[path]; ok && pod != poduid {
|
||||||
return fmt.Errorf("requesting quota on existing directory %s but different pod %s %s", path, pod, poduid)
|
return fmt.Errorf("requesting quota on existing directory %s but different pod %s %s", path, pod, poduid)
|
||||||
}
|
}
|
||||||
|
@ -598,13 +598,12 @@ func setupRCsPods(t *testing.T, gc *garbagecollector.GarbageCollector, clientSet
|
|||||||
}
|
}
|
||||||
orphan := false
|
orphan := false
|
||||||
switch {
|
switch {
|
||||||
//lint:file-ignore SA1019 Keep testing deprecated OrphanDependents option until it's being removed
|
case options.OrphanDependents == nil && options.PropagationPolicy == nil && len(initialFinalizers) == 0: //nolint:staticcheck // SA1019 Keep testing deprecated OrphanDependents option until it's being removed
|
||||||
case options.OrphanDependents == nil && options.PropagationPolicy == nil && len(initialFinalizers) == 0: //nolint:staticcheck
|
|
||||||
// if there are no deletion options, the default policy for replication controllers is orphan
|
// if there are no deletion options, the default policy for replication controllers is orphan
|
||||||
orphan = true
|
orphan = true
|
||||||
case options.OrphanDependents != nil: //nolint:staticcheck
|
case options.OrphanDependents != nil: //nolint:staticcheck // SA1019 Keep testing deprecated OrphanDependents option until it's being removed
|
||||||
// if the deletion options explicitly specify whether to orphan, that controls
|
// if the deletion options explicitly specify whether to orphan, that controls
|
||||||
orphan = *options.OrphanDependents //nolint:staticcheck
|
orphan = *options.OrphanDependents //nolint:staticcheck // SA1019 Keep testing deprecated OrphanDependents option until it's being removed
|
||||||
case options.PropagationPolicy != nil:
|
case options.PropagationPolicy != nil:
|
||||||
// if the deletion options explicitly specify whether to orphan, that controls
|
// if the deletion options explicitly specify whether to orphan, that controls
|
||||||
orphan = *options.PropagationPolicy == metav1.DeletePropagationOrphan
|
orphan = *options.PropagationPolicy == metav1.DeletePropagationOrphan
|
||||||
|
@ -439,8 +439,7 @@ func benchmarkScheduling(numExistingPods, minPods int,
|
|||||||
testPodStrategy testutils.TestPodCreateStrategy,
|
testPodStrategy testutils.TestPodCreateStrategy,
|
||||||
b *testing.B) {
|
b *testing.B) {
|
||||||
if b.N < minPods {
|
if b.N < minPods {
|
||||||
//lint:ignore SA3001 Set a minimum for b.N to get more meaningful results
|
b.N = minPods //nolint:staticcheck // SA3001 Set a minimum for b.N to get more meaningful results
|
||||||
b.N = minPods //nolint:staticcheck
|
|
||||||
}
|
}
|
||||||
finalFunc, podInformer, clientset, _ := mustSetupScheduler(nil)
|
finalFunc, podInformer, clientset, _ := mustSetupScheduler(nil)
|
||||||
defer finalFunc()
|
defer finalFunc()
|
||||||
|
Loading…
Reference in New Issue
Block a user