Skip to content

Commit 5fa5435

Browse files
authored
fix: enable shared sharding system accounts by default (#9890)
1 parent ab2c618 commit 5fa5435

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

controllers/apps/cluster/transformer_cluster_sharding_account.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)