1
1
/*
2
- Copyright 2017 The Kubernetes Authors.
2
+ Copyright 2019 The Kubernetes Authors.
3
3
4
4
Licensed under the Apache License, Version 2.0 (the "License");
5
5
you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@ limitations under the License.
16
16
17
17
// This code is lifted from the Kubernetes codebase and make some slight modifications in order to avoid relying on the k8s.io/kubernetes package.
18
18
// For reference:
19
- // https://github.com/kubernetes/kubernetes/blob/master /pkg/scheduler/framework/plugins/volumebinding/volume_binding.go
19
+ // https://github.com/kubernetes/kubernetes/blob/release-1.21 /pkg/scheduler/framework/plugins/volumebinding/volume_binding.go
20
20
21
21
package knodevolumebinding
22
22
@@ -115,14 +115,6 @@ func (pl *VolumeBinding) PreBind(ctx context.Context, cs *framework.CycleState,
115
115
116
116
// Reserve reserves volumes of pod and saves binding status in cycle state.
117
117
func (pl * VolumeBinding ) Reserve (_ context.Context , cs * framework.CycleState , p * corev1.Pod , nodeName string ) * framework.Status {
118
- nodeInfo , err := pl .frameworkHandler .SnapshotSharedLister ().NodeInfos ().Get (nodeName )
119
- if err != nil {
120
- return framework .NewStatus (framework .Error , "node not found" )
121
- }
122
- if helpers .HasKnodeTaint (nodeInfo .Node ()) {
123
- return nil
124
- }
125
-
126
118
state , err := getStateData (cs )
127
119
if err != nil {
128
120
return framework .AsStatus (err )
@@ -145,14 +137,6 @@ func (pl *VolumeBinding) Reserve(_ context.Context, cs *framework.CycleState, p
145
137
// Unreserve clears assumed PV and PVC cache.
146
138
// It's idempotent, and does nothing if no cache found for the given pod.
147
139
func (pl * VolumeBinding ) Unreserve (_ context.Context , cs * framework.CycleState , _ * corev1.Pod , nodeName string ) {
148
- nodeInfo , err := pl .frameworkHandler .SnapshotSharedLister ().NodeInfos ().Get (nodeName )
149
- if err != nil {
150
- return
151
- }
152
- if helpers .HasKnodeTaint (nodeInfo .Node ()) {
153
- return
154
- }
155
-
156
140
s , err := getStateData (cs )
157
141
if err != nil {
158
142
return
0 commit comments