@@ -30,12 +30,11 @@ use stackable_operator::{
3030 apps:: v1:: { DaemonSet , DaemonSetSpec , DaemonSetUpdateStrategy , RollingUpdateDaemonSet } ,
3131 core:: v1:: {
3232 EmptyDirVolumeSource , EnvVarSource , HTTPGetAction , ObjectFieldSelector , Probe ,
33- ResourceRequirements , SecretVolumeSource , ServiceAccount ,
33+ ResourceRequirements , SecretVolumeSource ,
3434 } ,
3535 } ,
3636 apimachinery:: pkg:: { apis:: meta:: v1:: LabelSelector , util:: intstr:: IntOrString } ,
3737 } ,
38- kube:: ResourceExt ,
3938 memory:: { BinaryMultiple , MemoryQuantity } ,
4039 product_logging:: {
4140 self ,
@@ -245,7 +244,7 @@ pub fn build_server_rolegroup_daemonset(
245244 role_group : & OpaRoleGroupConfig ,
246245 opa_bundle_builder_image : & str ,
247246 user_info_fetcher_image : & str ,
248- service_account : & ServiceAccount ,
247+ service_account_name : & str ,
249248 cluster_info : & KubernetesClusterInfo ,
250249) -> Result < DaemonSet > {
251250 let resolved_product_image = & cluster. image ;
@@ -405,7 +404,7 @@ pub fn build_server_rolegroup_daemonset(
405404 . build ( ) ,
406405 )
407406 . context ( AddVolumeSnafu ) ?
408- . service_account_name ( service_account . name_any ( ) )
407+ . service_account_name ( service_account_name )
409408 . security_context ( PodSecurityContextBuilder :: new ( ) . fs_group ( 1000 ) . build ( ) ) ;
410409
411410 if let Some ( tls) = & cluster. cluster_config . tls {
@@ -847,12 +846,7 @@ fn build_prepare_start_command(
847846#[ cfg( test) ]
848847mod tests {
849848 use serde_json:: json;
850- use stackable_operator:: {
851- commons:: networking:: DomainName ,
852- k8s_openapi:: {
853- api:: core:: v1:: ServiceAccount , apimachinery:: pkg:: apis:: meta:: v1:: ObjectMeta ,
854- } ,
855- } ;
849+ use stackable_operator:: commons:: networking:: DomainName ;
856850
857851 use super :: * ;
858852 use crate :: {
@@ -865,16 +859,6 @@ mod tests {
865859 }
866860 }
867861
868- fn service_account ( ) -> ServiceAccount {
869- ServiceAccount {
870- metadata : ObjectMeta {
871- name : Some ( "test-opa-serviceaccount" . to_owned ( ) ) ,
872- ..Default :: default ( )
873- } ,
874- ..Default :: default ( )
875- }
876- }
877-
878862 fn build ( cluster : & ValidatedCluster ) -> DaemonSet {
879863 let ( role_group_name, role_group) = cluster. role_group_configs [ & OpaRole :: Server ]
880864 . iter ( )
@@ -886,7 +870,7 @@ mod tests {
886870 role_group,
887871 "bundle-builder-image" ,
888872 "user-info-fetcher-image" ,
889- & service_account ( ) ,
873+ "test-opa-serviceaccount" ,
890874 & cluster_info ( ) ,
891875 )
892876 . expect ( "the daemonset should build" )
0 commit comments