fix: use proper addresses on dns nodes
This commit is contained in:
parent
3a38ff13ca
commit
b8cde30581
2 changed files with 4 additions and 4 deletions
|
|
@ -48,10 +48,10 @@ func parseState(state types.HostState) (string, []byte) {
|
||||||
var builder strings.Builder
|
var builder strings.Builder
|
||||||
|
|
||||||
for _, d := range state.Domains {
|
for _, d := range state.Domains {
|
||||||
builder.WriteString(fmt.Sprintf("%s %s\n", state.Name, d))
|
builder.WriteString(fmt.Sprintf("%s %s\n", state.Endpoint, d))
|
||||||
}
|
}
|
||||||
|
|
||||||
return hostsDir + state.Endpoint, []byte(builder.String())
|
return hostsDir + state.Name, []byte(builder.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Role) OnStartup(ctx context.Context) error {
|
func (r *Role) OnStartup(ctx context.Context) error {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ type Role struct {
|
||||||
|
|
||||||
func New(state *state.RuntimeState, config config.HostConfig) *Role {
|
func New(state *state.RuntimeState, config config.HostConfig) *Role {
|
||||||
return &Role{
|
return &Role{
|
||||||
client: newClient(config.Domain, config.IpAddress),
|
client: newClient(config.Domain, config.LocalAddress),
|
||||||
state: state,
|
state: state,
|
||||||
config: config,
|
config: config,
|
||||||
}
|
}
|
||||||
|
|
@ -87,7 +87,7 @@ func (r *Role) onCallback(w http.ResponseWriter, req *http.Request) {
|
||||||
func (r *Role) getInternal() (types.HostState, error) {
|
func (r *Role) getInternal() (types.HostState, error) {
|
||||||
return types.HostState{
|
return types.HostState{
|
||||||
Domains: r.internalDomains,
|
Domains: r.internalDomains,
|
||||||
Endpoint: r.state.Self.Address,
|
Endpoint: r.config.IpAddress,
|
||||||
Name: r.state.Self.Name,
|
Name: r.state.Self.Name,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue