mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
node: devicemgr: GA graduation implies Feature Gate is ON by default
Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
This commit is contained in:
parent
131704e71d
commit
752fa093e0
@ -256,14 +256,10 @@ if [[ (( "${KUBE_FEATURE_GATES:-}" == *"AllAlpha=true"* ) || ( "${KUBE_FEATURE_G
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Optional: set feature gates
|
# Optional: set feature gates
|
||||||
|
# shellcheck disable=SC2034 # Variables sourced in other scripts.
|
||||||
FEATURE_GATES="${KUBE_FEATURE_GATES:-}"
|
FEATURE_GATES="${KUBE_FEATURE_GATES:-}"
|
||||||
|
|
||||||
if [[ -n "${NODE_ACCELERATORS}" ]]; then
|
if [[ -n "${NODE_ACCELERATORS}" ]]; then
|
||||||
if [[ -z "${FEATURE_GATES:-}" ]]; then
|
|
||||||
FEATURE_GATES="DevicePlugins=true"
|
|
||||||
else
|
|
||||||
FEATURE_GATES="${FEATURE_GATES},DevicePlugins=true"
|
|
||||||
fi
|
|
||||||
if [[ "${NODE_ACCELERATORS}" =~ .*type=([a-zA-Z0-9-]+).* ]]; then
|
if [[ "${NODE_ACCELERATORS}" =~ .*type=([a-zA-Z0-9-]+).* ]]; then
|
||||||
NON_MASTER_NODE_LABELS="${NON_MASTER_NODE_LABELS},cloud.google.com/gke-accelerator=${BASH_REMATCH[1]}"
|
NON_MASTER_NODE_LABELS="${NON_MASTER_NODE_LABELS},cloud.google.com/gke-accelerator=${BASH_REMATCH[1]}"
|
||||||
fi
|
fi
|
||||||
|
@ -157,6 +157,7 @@ if [[ (( "${KUBE_FEATURE_GATES:-}" = *"AllAlpha=true"* ) || ( "${KUBE_FEATURE_GA
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Optional: set feature gates
|
# Optional: set feature gates
|
||||||
|
# shellcheck disable=SC2034 # Variables sourced in other scripts.
|
||||||
FEATURE_GATES=${KUBE_FEATURE_GATES:-}
|
FEATURE_GATES=${KUBE_FEATURE_GATES:-}
|
||||||
|
|
||||||
#Optional: disable the cloud provider no schedule taint for testing.
|
#Optional: disable the cloud provider no schedule taint for testing.
|
||||||
@ -305,11 +306,6 @@ if [[ ${KUBE_ENABLE_INSECURE_REGISTRY:-false} = 'true' ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "${NODE_ACCELERATORS}" ]]; then
|
if [[ -n "${NODE_ACCELERATORS}" ]]; then
|
||||||
if [[ -z "${FEATURE_GATES:-}" ]]; then
|
|
||||||
FEATURE_GATES='DevicePlugins=true'
|
|
||||||
else
|
|
||||||
FEATURE_GATES="${FEATURE_GATES},DevicePlugins=true"
|
|
||||||
fi
|
|
||||||
if [[ "${NODE_ACCELERATORS}" =~ .*type=([a-zA-Z0-9-]+).* ]]; then
|
if [[ "${NODE_ACCELERATORS}" =~ .*type=([a-zA-Z0-9-]+).* ]]; then
|
||||||
NON_MASTER_NODE_LABELS="${NON_MASTER_NODE_LABELS},cloud.google.com/gke-accelerator=${BASH_REMATCH[1]}"
|
NON_MASTER_NODE_LABELS="${NON_MASTER_NODE_LABELS},cloud.google.com/gke-accelerator=${BASH_REMATCH[1]}"
|
||||||
fi
|
fi
|
||||||
|
@ -33,9 +33,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/api/resource"
|
"k8s.io/apimachinery/pkg/api/resource"
|
||||||
errorsutil "k8s.io/apimachinery/pkg/util/errors"
|
errorsutil "k8s.io/apimachinery/pkg/util/errors"
|
||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
|
||||||
pluginapi "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1"
|
pluginapi "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1"
|
||||||
"k8s.io/kubernetes/pkg/features"
|
|
||||||
"k8s.io/kubernetes/pkg/kubelet/checkpointmanager"
|
"k8s.io/kubernetes/pkg/kubelet/checkpointmanager"
|
||||||
"k8s.io/kubernetes/pkg/kubelet/checkpointmanager/errors"
|
"k8s.io/kubernetes/pkg/kubelet/checkpointmanager/errors"
|
||||||
"k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/checkpoint"
|
"k8s.io/kubernetes/pkg/kubelet/cm/devicemanager/checkpoint"
|
||||||
@ -1005,15 +1003,12 @@ func (m *ManagerImpl) GetDevices(podUID, containerName string) ResourceDeviceIns
|
|||||||
// depending on whether the node has been recreated. Absence of the checkpoint file strongly indicates the node
|
// depending on whether the node has been recreated. Absence of the checkpoint file strongly indicates the node
|
||||||
// has been recreated.
|
// has been recreated.
|
||||||
func (m *ManagerImpl) ShouldResetExtendedResourceCapacity() bool {
|
func (m *ManagerImpl) ShouldResetExtendedResourceCapacity() bool {
|
||||||
if utilfeature.DefaultFeatureGate.Enabled(features.DevicePlugins) {
|
|
||||||
checkpoints, err := m.checkpointManager.ListCheckpoints()
|
checkpoints, err := m.checkpointManager.ListCheckpoints()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return len(checkpoints) == 0
|
return len(checkpoints) == 0
|
||||||
}
|
}
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *ManagerImpl) setPodPendingAdmission(pod *v1.Pod) {
|
func (m *ManagerImpl) setPodPendingAdmission(pod *v1.Pod) {
|
||||||
m.mutex.Lock()
|
m.mutex.Lock()
|
||||||
|
Loading…
Reference in New Issue
Block a user