@@ -489,8 +489,7 @@ func buildDatabaseStatefulSetConfigurationFunction(mdb databaseStatefulSetSource
489
489
490
490
if architectures .IsRunningStaticArchitecture (mdb .GetAnnotations ()) {
491
491
shareProcessNs = func (sts * appsv1.StatefulSet ) {
492
- a := true
493
- sts .Spec .Template .Spec .ShareProcessNamespace = & a
492
+ sts .Spec .Template .Spec .ShareProcessNamespace = ptr .To (true )
494
493
}
495
494
secondContainerModification = podtemplatespec .WithContainerByIndex (1 , container .WithVolumeMounts (volumeMounts ))
496
495
}
@@ -697,7 +696,7 @@ func buildMongoDBPodTemplateSpec(opts DatabaseStatefulSetOptions, mdb databaseSt
697
696
container .WithCommand ([]string {"bash" , "-c" , "tail -F -n0 ${MDB_LOG_FILE_MONGODB} mongodb_marker" }),
698
697
containerSecurityContext ,
699
698
)}
700
- staticContainerMongodContainerModification = podtemplatespec .WithContainerByIndex ( 1 , mongodModification ... )
699
+ staticContainerMongodContainerModification = podtemplatespec .WithContainer ( util . DatabaseContainerName , mongodModification ... )
701
700
702
701
// We are not setting the database-scripts volume on purpose,
703
702
// since we don't need to copy things from the init container over.
@@ -726,19 +725,17 @@ func buildMongoDBPodTemplateSpec(opts DatabaseStatefulSetOptions, mdb databaseSt
726
725
databaseContainerModifications = append (databaseContainerModifications , modification )
727
726
}
728
727
729
- serviceAccountName := getServiceAccountName (opts )
730
-
731
728
mods := []podtemplatespec.Modification {
732
729
sharedDatabaseConfiguration (opts , mdb ),
733
730
podtemplatespec .WithServiceAccount (util .MongoDBServiceAccount ),
734
- podtemplatespec .WithServiceAccount (serviceAccountName ),
731
+ podtemplatespec .WithServiceAccount (getServiceAccountName ( opts ) ),
735
732
podtemplatespec .WithVolumes (volumes ),
736
733
podtemplatespec .WithContainerByIndex (0 , databaseContainerModifications ... ),
737
734
staticContainerMongodContainerModification ,
738
735
}
739
736
740
737
if len (initContainerModifications ) > 0 {
741
- mods = append (mods , podtemplatespec .WithInitContainerByIndex ( 0 , initContainerModifications ... ))
738
+ mods = append (mods , podtemplatespec .WithInitContainer ( InitDatabaseContainerName , initContainerModifications ... ))
742
739
}
743
740
744
741
return podtemplatespec .Apply (mods ... )
0 commit comments