MCPcopy
hub / github.com/fluid-cloudnative/fluid / transformPodMetadata

Method transformPodMetadata

pkg/ddc/alluxio/transform.go:250–264  ·  view source on GitHub ↗
(runtime *datav1alpha1.AlluxioRuntime, value *Alluxio)

Source from the content-addressed store, hash-verified

248}
249
250func (e *AlluxioEngine) transformPodMetadata(runtime *datav1alpha1.AlluxioRuntime, value *Alluxio) (err error) {
251 // transform labels
252 commonLabels := utils.UnionMapsWithOverride(map[string]string{}, runtime.Spec.PodMetadata.Labels)
253 value.Master.Labels = utils.UnionMapsWithOverride(commonLabels, runtime.Spec.Master.PodMetadata.Labels)
254 value.Worker.Labels = utils.UnionMapsWithOverride(commonLabels, runtime.Spec.Worker.PodMetadata.Labels)
255 value.Fuse.Labels = utils.UnionMapsWithOverride(commonLabels, runtime.Spec.Fuse.PodMetadata.Labels)
256
257 // transform annotations
258 commonAnnotations := utils.UnionMapsWithOverride(map[string]string{}, runtime.Spec.PodMetadata.Annotations)
259 value.Master.Annotations = utils.UnionMapsWithOverride(commonAnnotations, runtime.Spec.Master.PodMetadata.Annotations)
260 value.Worker.Annotations = utils.UnionMapsWithOverride(commonAnnotations, runtime.Spec.Worker.PodMetadata.Annotations)
261 value.Fuse.Annotations = utils.UnionMapsWithOverride(commonAnnotations, runtime.Spec.Fuse.PodMetadata.Annotations)
262
263 return nil
264}
265
266// 2. Transform the masters
267func (e *AlluxioEngine) transformMasters(runtime *datav1alpha1.AlluxioRuntime,

Callers 2

transformMethod · 0.95
TestTransformPodMetadataFunction · 0.95

Calls 1

UnionMapsWithOverrideFunction · 0.92

Tested by 1

TestTransformPodMetadataFunction · 0.76