mirror of
https://gitea.elkins.co/Networking/ccl.git
synced 2025-03-09 12:41:40 -05:00
Resiliency to nil options
This commit is contained in:
parent
8449c17c23
commit
a2748ad1d5
@ -162,8 +162,15 @@ func Init(conn context.Context) error {
|
||||
return err
|
||||
}
|
||||
Containers, Networks, Options = p.Containers, p.Networks, p.Options
|
||||
var dom, dns, tsn, tsk string
|
||||
if Options != nil {
|
||||
dom = Options.DomainName
|
||||
dns = Options.DNSServer
|
||||
tsn = Options.TSIGName
|
||||
tsk = Options.TSIGKey
|
||||
}
|
||||
for i := range Containers {
|
||||
Containers[i].Init(conn, Networks, Options.DomainName, Options.DNSServer, Options.TSIGName, Options.TSIGKey)
|
||||
Containers[i].Init(conn, Networks, dom, dns, tsn, tsk)
|
||||
}
|
||||
slices.SortFunc(Containers, func(a, b *container.Container) bool {
|
||||
return a.Name < b.Name
|
||||
|
@ -47,6 +47,9 @@ func (c *Container) doReverse(rv string, dn string) error {
|
||||
}
|
||||
|
||||
func (c *Container) NsUpdateCommands() cmd.Set {
|
||||
if c.DomainName == "" || c.DnsServer == "" {
|
||||
return cmd.Set{ID: "NSUPDATE_NOT_CONFIGURED"}
|
||||
}
|
||||
hostname := c.Hostname
|
||||
if c.Hostname == "" {
|
||||
hostname = c.Name
|
||||
|
Loading…
x
Reference in New Issue
Block a user