Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/apis/clickhouse.altinity.com/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ type ChiTemplateNames struct {
// TODO unify with ChiReplica based on HostsSet
type ChiShard struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Weight int `json:"weight,omitempty" yaml:"weight,omitempty"`
Weight *int `json:"weight,omitempty" yaml:"weight,omitempty"`
InternalReplication *StringBool `json:"internalReplication,omitempty" yaml:"internalReplication,omitempty"`
Settings *Settings `json:"settings,omitempty" yaml:"settings,omitempty"`
Files *Settings `json:"files,omitempty" yaml:"files,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions pkg/model/ch_config_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ func (c *ClickHouseConfigGenerator) GetRemoteServers(options *RemoteServersGener
util.Iline(b, 16, "<internal_replication>%s</internal_replication>", shard.InternalReplication)

// <weight>X</weight>
if shard.Weight > 0 {
util.Iline(b, 16, "<weight>%d</weight>", shard.Weight)
if shard.Weight != nil {
util.Iline(b, 16, "<weight>%d</weight>", *shard.Weight)
}

shard.WalkHosts(func(host *chiv1.ChiHost) error {
Expand Down