Merge pull request #137167 from pohly/dra-device-taints-update-timestamp

DRA device taints: automatically bump TimeAdded when changing effect

Kubernetes-commit: 13010f06b270df96c4f558bdadcad93970000a53
This commit is contained in:
Kubernetes Publisher
2026-03-03 22:07:37 +05:30
6 changed files with 43 additions and 7 deletions

View File

@@ -43,8 +43,17 @@ type DeviceTaintApplyConfiguration struct {
// nodes is not valid here. More effects may get added in the future.
// Consumers must treat unknown effects like None.
Effect *resourcev1.DeviceTaintEffect `json:"effect,omitempty"`
// TimeAdded represents the time at which the taint was added.
// TimeAdded represents the time at which the taint was added or
// (only in a DeviceTaintRule) the effect was modified.
// Added automatically during create or update if not set.
//
// In addition, in a DeviceTaintRule a value provided during
// an update gets replaced with the current time if the provided
// value is the same as the old one and the new effect is different.
// Changing the key and/or value while keeping the effect unchanged
// is possible and does not update the time stamp because the eviction
// which uses it is either already started (NoExecute) or
// not started yet (NoEffect, NoSchedule).
TimeAdded *metav1.Time `json:"timeAdded,omitempty"`
}

View File

@@ -43,8 +43,17 @@ type DeviceTaintApplyConfiguration struct {
// nodes is not valid here. More effects may get added in the future.
// Consumers must treat unknown effects like None.
Effect *resourcev1alpha3.DeviceTaintEffect `json:"effect,omitempty"`
// TimeAdded represents the time at which the taint was added.
// TimeAdded represents the time at which the taint was added or
// (only in a DeviceTaintRule) the effect was modified.
// Added automatically during create or update if not set.
//
// In addition, in a DeviceTaintRule a value provided during
// an update gets replaced with the current time if the provided
// value is the same as the old one and the new effect is different.
// Changing the key and/or value while keeping the effect unchanged
// is possible and does not update the time stamp because the eviction
// which uses it is either already started (NoExecute) or
// not started yet (NoEffect, NoSchedule).
TimeAdded *v1.Time `json:"timeAdded,omitempty"`
}

View File

@@ -43,8 +43,17 @@ type DeviceTaintApplyConfiguration struct {
// nodes is not valid here. More effects may get added in the future.
// Consumers must treat unknown effects like None.
Effect *resourcev1beta1.DeviceTaintEffect `json:"effect,omitempty"`
// TimeAdded represents the time at which the taint was added.
// TimeAdded represents the time at which the taint was added or
// (only in a DeviceTaintRule) the effect was modified.
// Added automatically during create or update if not set.
//
// In addition, in a DeviceTaintRule a value provided during
// an update gets replaced with the current time if the provided
// value is the same as the old one and the new effect is different.
// Changing the key and/or value while keeping the effect unchanged
// is possible and does not update the time stamp because the eviction
// which uses it is either already started (NoExecute) or
// not started yet (NoEffect, NoSchedule).
TimeAdded *v1.Time `json:"timeAdded,omitempty"`
}

View File

@@ -43,8 +43,17 @@ type DeviceTaintApplyConfiguration struct {
// nodes is not valid here. More effects may get added in the future.
// Consumers must treat unknown effects like None.
Effect *resourcev1beta2.DeviceTaintEffect `json:"effect,omitempty"`
// TimeAdded represents the time at which the taint was added.
// TimeAdded represents the time at which the taint was added or
// (only in a DeviceTaintRule) the effect was modified.
// Added automatically during create or update if not set.
//
// In addition, in a DeviceTaintRule a value provided during
// an update gets replaced with the current time if the provided
// value is the same as the old one and the new effect is different.
// Changing the key and/or value while keeping the effect unchanged
// is possible and does not update the time stamp because the eviction
// which uses it is either already started (NoExecute) or
// not started yet (NoEffect, NoSchedule).
TimeAdded *v1.Time `json:"timeAdded,omitempty"`
}

2
go.mod
View File

@@ -23,7 +23,7 @@ require (
golang.org/x/time v0.14.0
google.golang.org/protobuf v1.36.11
gopkg.in/evanphx/json-patch.v4 v4.13.0
k8s.io/api v0.0.0-20260228003330-ffec185e33c1
k8s.io/api v0.0.0-20260303202014-605cb02318a5
k8s.io/apimachinery v0.0.0-20260227203245-48224b4d1ddb
k8s.io/klog/v2 v2.130.1
k8s.io/kube-openapi v0.0.0-20260127142750-a19766b6e2d4

4
go.sum
View File

@@ -123,8 +123,8 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.0.0-20260228003330-ffec185e33c1 h1:MGM2os4B0eoRhzOoYVpALEQNLOPynaGGerEUoP/0u6s=
k8s.io/api v0.0.0-20260228003330-ffec185e33c1/go.mod h1:qhb/XTo9jEH6dtv01aF9OubVFb/O4rILeIUv25AhTbw=
k8s.io/api v0.0.0-20260303202014-605cb02318a5 h1:dsTzpa8GpQOvVwLCfHLrYf2Ay6Ts3ryD40BbDuhhAVE=
k8s.io/api v0.0.0-20260303202014-605cb02318a5/go.mod h1:qhb/XTo9jEH6dtv01aF9OubVFb/O4rILeIUv25AhTbw=
k8s.io/apimachinery v0.0.0-20260227203245-48224b4d1ddb h1:0MWXuP1Qkr2TJBSQ2qYrHARDtTXH4TeTZ9q8OPHOQFM=
k8s.io/apimachinery v0.0.0-20260227203245-48224b4d1ddb/go.mod h1:zqp0Kd80VeQZHyQ4j0VW/sn9zTHYeXFd/brJe5Po20w=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=