mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
Clean up remove caddy refs (#139)
* Changed reference to Caddy over to CoreDNS * Removing references to caddy * Fixed misleading error message to reference coredns * Cleaning up references to caddy * Adding clean and deps targets Muscle memory is resulting in "make clean" commands. * Adding test target to makefile * More "Caddy" cleanup
This commit is contained in:
committed by
Miek Gieben
parent
bba63f7765
commit
e34280e7af
16
main.go
16
main.go
@@ -84,13 +84,13 @@ func main() {
|
||||
}
|
||||
|
||||
// Get Corefile input
|
||||
caddyfile, err := core.LoadCaddyfile(loadCaddyfile)
|
||||
corefile, err := core.LoadCorefile(loadCorefile)
|
||||
if err != nil {
|
||||
mustLogFatal(err)
|
||||
}
|
||||
|
||||
// Start your engines
|
||||
err = core.Start(caddyfile)
|
||||
err = core.Start(corefile)
|
||||
if err != nil {
|
||||
mustLogFatal(err)
|
||||
}
|
||||
@@ -112,11 +112,11 @@ func mustLogFatal(args ...interface{}) {
|
||||
log.Fatal(args...)
|
||||
}
|
||||
|
||||
func loadCaddyfile() (core.Input, error) {
|
||||
func loadCorefile() (core.Input, error) {
|
||||
// Try -conf flag
|
||||
if conf != "" {
|
||||
if conf == "stdin" {
|
||||
return core.CaddyfileFromPipe(os.Stdin)
|
||||
return core.CorefileFromPipe(os.Stdin)
|
||||
}
|
||||
|
||||
contents, err := ioutil.ReadFile(conf)
|
||||
@@ -124,7 +124,7 @@ func loadCaddyfile() (core.Input, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return core.CaddyfileInput{
|
||||
return core.CorefileInput{
|
||||
Contents: contents,
|
||||
Filepath: conf,
|
||||
RealFile: true,
|
||||
@@ -134,13 +134,13 @@ func loadCaddyfile() (core.Input, error) {
|
||||
// command line args
|
||||
if flag.NArg() > 0 {
|
||||
confBody := core.Host + ":" + core.Port + "\n" + strings.Join(flag.Args(), "\n")
|
||||
return core.CaddyfileInput{
|
||||
return core.CorefileInput{
|
||||
Contents: []byte(confBody),
|
||||
Filepath: "args",
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Caddyfile in cwd
|
||||
// Corefile in cwd
|
||||
contents, err := ioutil.ReadFile(core.DefaultConfigFile)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
@@ -148,7 +148,7 @@ func loadCaddyfile() (core.Input, error) {
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
return core.CaddyfileInput{
|
||||
return core.CorefileInput{
|
||||
Contents: contents,
|
||||
Filepath: core.DefaultConfigFile,
|
||||
RealFile: true,
|
||||
|
||||
Reference in New Issue
Block a user