From 95442253026f9b3278aa9543a91eb9ca3972cc5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E4=BC=9F=E8=BD=A9?= <359143905@qq.com> Date: Sat, 9 May 2026 20:36:25 +0800 Subject: [PATCH] Use llm to add commnents: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄伟轩 <359143905@qq.com> --- pkg/ddc/base/runtime.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/ddc/base/runtime.go b/pkg/ddc/base/runtime.go index d82af8ffa2d..b94c81d1fa3 100644 --- a/pkg/ddc/base/runtime.go +++ b/pkg/ddc/base/runtime.go @@ -225,6 +225,19 @@ func (info *RuntimeInfo) GetMetadataList() []datav1alpha1.Metadata { return info.metadataList } +// WithAnnotations creates a RuntimeInfoOption that sets the annotations field of RuntimeInfo. +// The annotations map usually comes from the Kubernetes runtime object, such as AlluxioRuntime, +// JindoRuntime, GooseFSRuntime, JuiceFSRuntime, ThinRuntime, EFCRuntime, VineyardRuntime, or CacheRuntime. +// These annotations are stored in RuntimeInfo so that other components can later retrieve them through +// GetAnnotations and use them when building, reconciling, or processing runtime-related resources. +// The function itself does not validate, copy, or transform the input annotations map; it directly assigns +// the provided map to RuntimeInfo.annotations. +// +// Parameters: +// - annotations: A map containing annotation key-value pairs associated with the runtime object. +// +// Returns: +// - RuntimeInfoOption: An option function that writes the given annotations into RuntimeInfo. func WithAnnotations(annotations map[string]string) RuntimeInfoOption { return func(info *RuntimeInfo) error { info.annotations = annotations