MCPcopy Index your code
hub / github.com/apecloud/kubeblocks / BuildConfigMapWithTemplate

Function BuildConfigMapWithTemplate

pkg/controller/factory/builder.go:279–293  ·  view source on GitHub ↗

TODO: add dynamicLabels and dynamicAnnotations by @zhangtao

(cluster *kbappsv1.Cluster,
	synthesizedComp *component.SynthesizedComponent,
	configs map[string]string,
	cmName string,
	configTemplateSpec kbappsv1.ComponentFileTemplate)

Source from the content-addressed store, hash-verified

277// TODO: add dynamicLabels and dynamicAnnotations by @zhangtao
278
279func BuildConfigMapWithTemplate(cluster *kbappsv1.Cluster,
280 synthesizedComp *component.SynthesizedComponent,
281 configs map[string]string,
282 cmName string,
283 configTemplateSpec kbappsv1.ComponentFileTemplate) *corev1.ConfigMap {
284 return builder.NewConfigMapBuilder(cluster.Namespace, cmName).
285 AddLabelsInMap(synthesizedComp.StaticLabels).
286 AddLabelsInMap(constant.GetCompLabels(cluster.Name, synthesizedComp.Name)).
287 AddLabels(constant.CMConfigurationTypeLabelKey, constant.ConfigInstanceType).
288 AddLabels(constant.CMTemplateNameLabelKey, configTemplateSpec.Template).
289 AddAnnotationsInMap(synthesizedComp.StaticAnnotations).
290 AddAnnotations(constant.DisableUpgradeInsConfigurationAnnotationKey, strconv.FormatBool(false)).
291 SetData(configs).
292 GetObject()
293}
294
295func BuildCfgManagerContainer(sidecarRenderedParam *cfgcm.CfgManagerBuildParams) (*corev1.Container, error) {
296 var env []corev1.EnvVar

Callers 2

builder_test.goFile · 0.85

Calls 8

NewConfigMapBuilderFunction · 0.92
GetCompLabelsFunction · 0.92
GetObjectMethod · 0.45
SetDataMethod · 0.45
AddAnnotationsMethod · 0.45
AddAnnotationsInMapMethod · 0.45
AddLabelsMethod · 0.45
AddLabelsInMapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…