Skip to content

Commit

Permalink
chore: apply labels and annotations from the user to the its object (#…
Browse files Browse the repository at this point in the history
…8838)

(cherry picked from commit 309ab9c)
  • Loading branch information
leon-inf committed Jan 21, 2025
1 parent ec6611e commit 3ade90d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/controller/factory/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func BuildInstanceSet(synthesizedComp *component.SynthesizedComponent, component
)

podBuilder := builder.NewPodBuilder("", "").
// Priority: static < dynamic < built-in
// priority: static < dynamic < built-in
AddLabelsInMap(synthesizedComp.StaticLabels).
AddLabelsInMap(synthesizedComp.DynamicLabels).
AddLabelsInMap(constant.GetCompLabels(clusterName, compName, synthesizedComp.Labels)).
Expand All @@ -65,7 +65,9 @@ func BuildInstanceSet(synthesizedComp *component.SynthesizedComponent, component

itsName := constant.GenerateWorkloadNamePattern(clusterName, compName)
itsBuilder := builder.NewInstanceSetBuilder(namespace, itsName).
// priority: static < dynamic < built-in
AddLabelsInMap(synthesizedComp.StaticLabels).
AddLabelsInMap(synthesizedComp.DynamicLabels).
AddLabelsInMap(constant.GetCompLabels(clusterName, compName)).
AddAnnotations(constant.KubeBlocksGenerationKey, synthesizedComp.Generation).
AddAnnotations(constant.CRDAPIVersionAnnotationKey, workloads.GroupVersion.String()).
Expand Down

0 comments on commit 3ade90d

Please sign in to comment.