@@ -25,6 +25,7 @@ import (
2525 corev1 "k8s.io/api/core/v1"
2626 apierrors "k8s.io/apimachinery/pkg/api/errors"
2727 "k8s.io/apimachinery/pkg/types"
28+ "k8s.io/utils/ptr"
2829 "sigs.k8s.io/controller-runtime/pkg/client"
2930
3031 appsv1 "github.com/apecloud/kubeblocks/apis/apps/v1"
@@ -62,7 +63,7 @@ func (t *clusterShardingAccountTransformer) reconcileShardingAccounts(transCtx *
6263 shardDef , ok := transCtx .shardingDefs [sharding .ShardingDef ]
6364 if ok {
6465 for _ , account := range shardDef .Spec .SystemAccounts {
65- if account . Shared != nil && * account .Shared {
66+ if ptr . Deref ( account .Shared , false ) {
6667 if err := t .reconcileShardingAccount (transCtx , graphCli , dag , sharding , account .Name ); err != nil {
6768 return err
6869 }
@@ -195,7 +196,8 @@ func (t *clusterShardingAccountTransformer) rewriteSystemAccount(transCtx *clust
195196 cluster = transCtx .Cluster
196197 )
197198 newAccount := appsv1.ComponentSystemAccount {
198- Name : accountName ,
199+ Name : accountName ,
200+ Disabled : ptr .To (false ), // default to false
199201 SecretRef : & appsv1.ProvisionSecretRef {
200202 Name : shardingAccountSecretName (cluster .Name , shardingName , accountName ),
201203 Namespace : cluster .Namespace ,
0 commit comments