mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #99487 from chymy/fix-staticcheck0226
Fix staticcheck failures for pkg/controller/replicaset and pkg/kubelet/dockershim
This commit is contained in:
commit
86fdf7b56e
@ -1,6 +1,4 @@
|
||||
cluster/images/etcd/migrate
|
||||
pkg/controller/replicaset
|
||||
pkg/kubelet/dockershim
|
||||
vendor/k8s.io/apimachinery/pkg/api/apitesting/roundtrip
|
||||
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation
|
||||
vendor/k8s.io/apimachinery/pkg/runtime/serializer/json
|
||||
|
@ -504,13 +504,6 @@ func TestPodControllerLookup(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// byName sorts pods by their names.
|
||||
type byName []*v1.Pod
|
||||
|
||||
func (pods byName) Len() int { return len(pods) }
|
||||
func (pods byName) Swap(i, j int) { pods[i], pods[j] = pods[j], pods[i] }
|
||||
func (pods byName) Less(i, j int) bool { return pods[i].Name < pods[j].Name }
|
||||
|
||||
func TestRelatedPodsLookup(t *testing.T) {
|
||||
someRS := newReplicaSet(1, map[string]string{"foo": "bar"})
|
||||
someRS.Name = "foo1"
|
||||
@ -1222,7 +1215,7 @@ func TestExpectationsOnRecreate(t *testing.T) {
|
||||
t.Fatalf("Deleting RS didn't result in new item in the queue: %v", err)
|
||||
}
|
||||
|
||||
rsExp, exists, err = manager.expectations.GetExpectations(oldRSKey)
|
||||
_, exists, err = manager.expectations.GetExpectations(oldRSKey)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
@ -180,6 +180,7 @@ func (ds *dockerService) CreateContainer(_ context.Context, r *runtimeapi.Create
|
||||
}
|
||||
hc.Resources.Devices = devices
|
||||
|
||||
//lint:ignore SA1019 backwards compatibility
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user