Merge pull request #135196 from harche/i133202

KEP-4680: Add message field support to DRA device health reporting

Kubernetes-commit: be6162afb876e60ded92780786519c976fc0be08
This commit is contained in:
Kubernetes Publisher
2026-03-04 00:11:24 +05:30
4 changed files with 17 additions and 3 deletions

View File

@@ -41,6 +41,9 @@ type ResourceHealthApplyConfiguration struct {
//
// In future we may want to introduce the PermanentlyUnhealthy Status.
Health *corev1.ResourceHealthStatus `json:"health,omitempty"`
// Message provides human-readable context for Health (e.g. "ECC error count exceeded threshold").
// This field is populated by the kubelet when ResourceHealthStatusMessage is enabled if the DRA plugin returns a message, and is null otherwise.
Message *string `json:"message,omitempty"`
}
// ResourceHealthApplyConfiguration constructs a declarative configuration of the ResourceHealth type for use with
@@ -64,3 +67,11 @@ func (b *ResourceHealthApplyConfiguration) WithHealth(value corev1.ResourceHealt
b.Health = &value
return b
}
// WithMessage sets the Message field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Message field is set to the value of the last call.
func (b *ResourceHealthApplyConfiguration) WithMessage(value string) *ResourceHealthApplyConfiguration {
b.Message = &value
return b
}

View File

@@ -7519,6 +7519,9 @@ var schemaYAML = typed.YAMLObject(`types:
- name: health
type:
scalar: string
- name: message
type:
scalar: string
- name: resourceID
type:
scalar: string

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-20260303202014-605cb02318a5
k8s.io/api v0.0.0-20260303202015-13e1054b051a
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-20260303202014-605cb02318a5 h1:dsTzpa8GpQOvVwLCfHLrYf2Ay6Ts3ryD40BbDuhhAVE=
k8s.io/api v0.0.0-20260303202014-605cb02318a5/go.mod h1:qhb/XTo9jEH6dtv01aF9OubVFb/O4rILeIUv25AhTbw=
k8s.io/api v0.0.0-20260303202015-13e1054b051a h1:Tevx3r+RgIlXg5kdBJaiaK3cDoMRck8MMTgRwmVCOi8=
k8s.io/api v0.0.0-20260303202015-13e1054b051a/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=