@@ -795,10 +795,7 @@ func (r *DesignateReconciler) reconcileNormal(ctx context.Context, instance *des
795795
796796 // Handle Mdns predictable IPs configmap
797797 // We cannot have 0 mDNS pods so even though the CRD validation allows 0, don't allow it.
798- mdnsReplicaCount := int (* instance .Spec .DesignateMdns .Replicas )
799- if mdnsReplicaCount < 1 {
800- mdnsReplicaCount = 1
801- }
798+ mdnsReplicaCount := max (int (* instance .Spec .DesignateMdns .Replicas ), 1 )
802799 var mdnsNames []string
803800 for i := 0 ; i < mdnsReplicaCount ; i ++ {
804801 mdnsNames = append (mdnsNames , fmt .Sprintf ("mdns_address_%d" , i ))
@@ -826,7 +823,7 @@ func (r *DesignateReconciler) reconcileNormal(ctx context.Context, instance *des
826823 // value is a byob case. Something to think about.
827824 bindReplicaCount := int (* instance .Spec .DesignateBackendbind9 .Replicas )
828825 var bindNames []string
829- for i := 0 ; i < bindReplicaCount ; i ++ {
826+ for i := range bindReplicaCount {
830827 bindNames = append (bindNames , fmt .Sprintf ("bind_address_%d" , i ))
831828 }
832829
@@ -1334,7 +1331,7 @@ func (r *DesignateReconciler) generateServiceConfigMaps(
13341331 }
13351332 newKeysMap := make (map [string ][]byte )
13361333
1337- for i := 0 ; i < replicas ; i ++ {
1334+ for i := range replicas {
13381335 keyName := fmt .Sprintf ("%s-%v" , designate .DesignateRndcKey , i )
13391336
13401337 if key , exists := secret .Data [keyName ]; exists {
@@ -1379,7 +1376,7 @@ func (r *DesignateReconciler) generateServiceConfigMaps(
13791376
13801377 // We only need a minimal 00-config.conf that is only used by db-sync job,
13811378 // hence only passing the database related parameters
1382- templateParameters := map [string ]interface {} {
1379+ templateParameters := map [string ]any {
13831380 "MinimalConfig" : true , // This tells the template to generate a minimal config
13841381 "DatabaseConnection" : fmt .Sprintf ("mysql+pymysql://%s:%s@%s/%s?read_default_file=/etc/my.cnf" ,
13851382 databaseAccount .Spec .UserName ,
@@ -1515,7 +1512,7 @@ func (r *DesignateReconciler) createHashOfInputHashes(
15151512 instance * designatev1beta1.Designate ,
15161513 hashType string ,
15171514 envVars map [string ]env.Setter ,
1518- additionalConfigmaps []interface {} ,
1515+ additionalConfigmaps []any ,
15191516) (string , bool , error ) {
15201517 Log := r .GetLogger (ctx )
15211518
0 commit comments