@@ -10,7 +10,7 @@ import (
10
10
"sigs.k8s.io/controller-runtime/pkg/client"
11
11
12
12
api "github.com/ydb-platform/ydb-kubernetes-operator/api/v1alpha1"
13
- "github.com/ydb-platform/ydb-kubernetes-operator/internal/annotations "
13
+ "github.com/ydb-platform/ydb-kubernetes-operator/internal/labels "
14
14
"github.com/ydb-platform/ydb-kubernetes-operator/internal/ptr"
15
15
)
16
16
@@ -58,16 +58,20 @@ func (b *StorageInitJobBuilder) Placeholder(cr client.Object) client.Object {
58
58
59
59
func GetInitJobBuilder (storage * api.Storage ) ResourceBuilder {
60
60
jobName := fmt .Sprintf (InitJobNameFormat , storage .Name )
61
- jobLabels := StorageLabels (storage )
62
- jobAnnotations := annotations . GetYdbTechAnnotations (storage .Annotations )
63
- delete ( jobAnnotations , annotations . LastAppliedAnnotation )
61
+ jobLabels := labels . Common (storage . Name , labels. Labels {} )
62
+ jobLabels . Merge (storage .Spec . AdditionalLabels )
63
+ jobAnnotations := CopyDict ( storage . Spec . AdditionalAnnotations )
64
64
65
65
if storage .Spec .InitJob != nil {
66
66
if storage .Spec .InitJob .AdditionalLabels != nil {
67
- jobLabels .Merge (storage .Spec .InitJob .AdditionalLabels )
67
+ for k , v := range storage .Spec .InitJob .AdditionalLabels {
68
+ jobLabels [k ] = v
69
+ }
68
70
}
69
71
if storage .Spec .InitJob .AdditionalAnnotations != nil {
70
- jobAnnotations = CopyDict (storage .Spec .InitJob .AdditionalAnnotations )
72
+ for k , v := range storage .Spec .InitJob .AdditionalAnnotations {
73
+ jobAnnotations [k ] = v
74
+ }
71
75
}
72
76
}
73
77
0 commit comments