From 7bb07cbe8e015525739a9926ee47f7305b2b696f Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Arango Gutierrez Date: Mon, 10 Nov 2025 15:50:09 -0500 Subject: [PATCH] KEP-4680: Add message field support to DRA device health reporting Author: Carlos Eduardo Arango Gutierrez Co-Authored-By: Harshal Patil <12152047+harche@users.noreply.github.com> Signed-off-by: Harshal Patil <12152047+harche@users.noreply.github.com> Kubernetes-commit: ad6c155449e38d7cca22230fdb99ae02b65ccb59 --- applyconfigurations/core/v1/resourcehealth.go | 11 +++++++++++ applyconfigurations/internal/internal.go | 3 +++ 2 files changed, 14 insertions(+) diff --git a/applyconfigurations/core/v1/resourcehealth.go b/applyconfigurations/core/v1/resourcehealth.go index 684153c49..061535b8d 100644 --- a/applyconfigurations/core/v1/resourcehealth.go +++ b/applyconfigurations/core/v1/resourcehealth.go @@ -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 +} diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 251245afb..ebf35632d 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -7519,6 +7519,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: health type: scalar: string + - name: message + type: + scalar: string - name: resourceID type: scalar: string