mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Merge pull request #76309 from jiatongw/e2e_gpu
Clean up and remove blank lines
This commit is contained in:
commit
99a52350a4
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
package framework
|
package framework
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/uuid"
|
"k8s.io/apimachinery/pkg/util/uuid"
|
||||||
"k8s.io/klog"
|
"k8s.io/klog"
|
||||||
@ -40,11 +40,9 @@ const (
|
|||||||
// TODO make this generic and not linked to COS only
|
// TODO make this generic and not linked to COS only
|
||||||
func NumberOfNVIDIAGPUs(node *v1.Node) int64 {
|
func NumberOfNVIDIAGPUs(node *v1.Node) int64 {
|
||||||
val, ok := node.Status.Capacity[NVIDIAGPUResourceName]
|
val, ok := node.Status.Capacity[NVIDIAGPUResourceName]
|
||||||
|
|
||||||
if !ok {
|
if !ok {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
return val.Value()
|
return val.Value()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,12 +55,10 @@ func NVIDIADevicePlugin() *v1.Pod {
|
|||||||
Name: "device-plugin-nvidia-gpu-" + string(uuid.NewUUID()),
|
Name: "device-plugin-nvidia-gpu-" + string(uuid.NewUUID()),
|
||||||
Namespace: metav1.NamespaceSystem,
|
Namespace: metav1.NamespaceSystem,
|
||||||
},
|
},
|
||||||
|
|
||||||
Spec: ds.Spec.Template.Spec,
|
Spec: ds.Spec.Template.Spec,
|
||||||
}
|
}
|
||||||
// Remove node affinity
|
// Remove node affinity
|
||||||
p.Spec.Affinity = nil
|
p.Spec.Affinity = nil
|
||||||
|
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user