@@ -29,23 +29,14 @@ func NewDatabase(ydbCr *api.Database) DatabaseBuilder {
29
29
30
30
func (b * DatabaseBuilder ) NewLabels () labels.Labels {
31
31
l := labels .Common (b .Name , b .Labels )
32
-
33
- l .Merge (b .Spec .AdditionalLabels )
34
32
l .Merge (map [string ]string {labels .ComponentKey : labels .DynamicComponent })
35
33
36
34
return l
37
35
}
38
36
39
- func (b * DatabaseBuilder ) NewAnnotations () map [ string ] string {
37
+ func (b * DatabaseBuilder ) NewAnnotations () annotations. Annotations {
40
38
an := annotations .Common (b .Annotations )
41
39
42
- an .Merge (b .Spec .AdditionalAnnotations )
43
- if b .Spec .Configuration != "" {
44
- an .Merge (map [string ]string {annotations .ConfigurationChecksum : GetSHA256Checksum (b .Spec .Configuration )})
45
- } else {
46
- an .Merge (map [string ]string {annotations .ConfigurationChecksum : GetSHA256Checksum (b .Storage .Spec .Configuration )})
47
- }
48
-
49
40
return an
50
41
}
51
42
@@ -62,8 +53,17 @@ func (b *DatabaseBuilder) GetResourceBuilders(restConfig *rest.Config) []Resourc
62
53
databaseAnnotations := b .NewAnnotations ()
63
54
64
55
statefulSetLabels := databaseLabels .Copy ()
56
+ statefulSetLabels .Merge (b .Spec .AdditionalLabels )
65
57
statefulSetLabels .Merge (map [string ]string {labels .StatefulsetComponent : b .Name })
66
58
59
+ statefulSetAnnotations := databaseAnnotations .Copy ()
60
+ statefulSetAnnotations .Merge (b .Spec .AdditionalAnnotations )
61
+ if b .Spec .Configuration != "" {
62
+ statefulSetAnnotations .Merge (map [string ]string {annotations .ConfigurationChecksum : GetSHA256Checksum (b .Spec .Configuration )})
63
+ } else {
64
+ statefulSetAnnotations .Merge (map [string ]string {annotations .ConfigurationChecksum : GetSHA256Checksum (b .Storage .Spec .Configuration )})
65
+ }
66
+
67
67
grpcServiceLabels := databaseLabels .Copy ()
68
68
grpcServiceLabels .Merge (b .Spec .Service .GRPC .AdditionalLabels )
69
69
grpcServiceLabels .Merge (map [string ]string {labels .ServiceComponent : labels .GRPCComponent })
@@ -205,7 +205,7 @@ func (b *DatabaseBuilder) GetResourceBuilders(restConfig *rest.Config) []Resourc
205
205
206
206
Name : b .Name ,
207
207
Labels : statefulSetLabels ,
208
- Annotations : databaseAnnotations ,
208
+ Annotations : statefulSetAnnotations ,
209
209
},
210
210
)
211
211
} else {
@@ -235,6 +235,11 @@ func (b *DatabaseBuilder) getNodeSetBuilders(
235
235
236
236
nodeSetAnnotations := databaseAnnotations .Copy ()
237
237
nodeSetAnnotations .Merge (nodeSetSpecInline .Annotations )
238
+ if b .Spec .Configuration != "" {
239
+ nodeSetAnnotations .Merge (map [string ]string {annotations .ConfigurationChecksum : GetSHA256Checksum (b .Spec .Configuration )})
240
+ } else {
241
+ nodeSetAnnotations .Merge (map [string ]string {annotations .ConfigurationChecksum : GetSHA256Checksum (b .Storage .Spec .Configuration )})
242
+ }
238
243
239
244
databaseNodeSetSpec := b .recastDatabaseNodeSetSpecInline (nodeSetSpecInline .DeepCopy ())
240
245
if nodeSetSpecInline .Remote != nil {
0 commit comments