Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added discovery_server section into master config #169

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 7 additions & 0 deletions pkg/ytconfig/canondata/TestGetMasterConfig/test.canondata
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,11 @@
};
"secondary_masters"=[
];
"discovery_server"={
addresses=[
"ds-test-0.discovery-test.fake.svc.fake.zone:9020";
"ds-test-1.discovery-test.fake.svc.fake.zone:9020";
"ds-test-2.discovery-test.fake.svc.fake.zone:9020";
];
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,8 @@
};
"secondary_masters"=[
];
"discovery_server"={
addresses=[
];
};
}
1 change: 1 addition & 0 deletions pkg/ytconfig/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ func (g *Generator) getMasterConfigImpl(spec *ytv1.MastersSpec) (MasterServer, e
g.fillCommonService(&c.CommonServer, &spec.InstanceSpec)
g.fillBusServer(&c.CommonServer, spec.NativeTransport)
g.fillPrimaryMaster(&c.PrimaryMaster)
c.DiscoveryServers.Addresses = g.getDiscoveryAddresses()
configureMasterServerCypressManager(g.ytsaurus.Spec, &c.CypressManager)

// COMPAT(l0kix2): remove that after we drop support for specifying host network without master host addresses.
Expand Down
5 changes: 5 additions & 0 deletions pkg/ytconfig/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ type CypressManager struct {
DefaultJournalWriteQuorum int `yson:"default_journal_write_quorum,omitempty"`
}

type DiscoveryServers struct {
AddressList
}

type MasterServer struct {
CommonServer
Snapshots MasterSnapshots `yson:"snapshots"`
Expand All @@ -37,6 +41,7 @@ type MasterServer struct {
CypressManager CypressManager `yson:"cypress_manager"`
PrimaryMaster MasterCell `yson:"primary_master"`
SecondaryMasters []MasterCell `yson:"secondary_masters"`
DiscoveryServers DiscoveryServers `yson:"discovery_server"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the naming consistent with the yson config name. So DiscoveryServer without the plural.

}

func getMasterLogging(spec *ytv1.MastersSpec) Logging {
Expand Down
Loading