Skip to content

Commit

Permalink
Addresses issue 26 if i understand it correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
gpapilion committed May 19, 2014
1 parent ad2ba94 commit 9a15376
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,20 @@ func setupZoneData(data map[string]interface{}, Zone *Zone) {
}
}

// loop over exisiting labels, create zone records for missing sub-domains
for k := range Zone.Labels {
if strings.Contains(k, ".") {
subLabels := strings.Split(k, ".")
for i := 1; i < len(subLabels); i++ {
subSubLabel := strings.Join(subLabels[i:len(subLabels)], ".")
if _, ok := Zone.Labels[subSubLabel]; !ok {
Zone.AddLabel(subSubLabel)
}
}

}
}

setupSOA(Zone)

//log.Println(Zones[k])
Expand Down

0 comments on commit 9a15376

Please sign in to comment.