mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 10:13:14 -04:00 
			
		
		
		
	plugin/federation: Add upstream option to federation (#2177)
* add upstream * add upstream * debug ci * debug ci * set context * update readme * update readme * remove empty if
This commit is contained in:
		
				
					committed by
					
						 Francois Tur
						Francois Tur
					
				
			
			
				
	
			
			
			
						parent
						
							1847ef6bd3
						
					
				
				
					commit
					6beeabc47c
				
			| @@ -6,6 +6,7 @@ import ( | ||||
| 	"github.com/coredns/coredns/core/dnsserver" | ||||
| 	"github.com/coredns/coredns/plugin" | ||||
| 	"github.com/coredns/coredns/plugin/kubernetes" | ||||
| 	"github.com/coredns/coredns/plugin/pkg/upstream" | ||||
| 	"github.com/miekg/dns" | ||||
|  | ||||
| 	"github.com/mholt/caddy" | ||||
| @@ -62,6 +63,13 @@ func federationParse(c *caddy.Controller) (*Federation, error) { | ||||
| 		for c.NextBlock() { | ||||
| 			x := c.Val() | ||||
| 			switch x { | ||||
| 			case "upstream": | ||||
| 				args := c.RemainingArgs() | ||||
| 				u, err := upstream.New(args) | ||||
| 				if err != nil { | ||||
| 					return nil, err | ||||
| 				} | ||||
| 				fed.Upstream = &u | ||||
| 			default: | ||||
| 				args := c.RemainingArgs() | ||||
| 				if x := len(args); x != 1 { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user