Skip to content

Commit

Permalink
Add DNS capabilities.
Browse files Browse the repository at this point in the history
Signed-off-by: Lantao Liu <lantaol@google.com>
  • Loading branch information
Random-Liu committed Aug 22, 2019
1 parent 49fbd9b commit cebe997
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions namespace_opts.go
Expand Up @@ -42,6 +42,14 @@ func WithCapabilityBandWidth(bandWidth BandWidth) NamespaceOpts {
}
}

// WithCapabilityDNS adds support for dns
func WithCapabilityDNS(dns DNS) NamespaceOpts {
return func(c *Namespace) error {
c.capabilityArgs["dns"] = dns
return nil
}
}

func WithCapability(name string, capability interface{}) NamespaceOpts {
return func(c *Namespace) error {
c.capabilityArgs[name] = capability
Expand Down
10 changes: 10 additions & 0 deletions types.go
Expand Up @@ -53,3 +53,13 @@ type BandWidth struct {
EgressRate uint64
EgressBurst uint64
}

// DNS defines the dns config
type DNS struct {
// List of DNS servers of the cluster.
Servers []string
// List of DNS search domains of the cluster.
Searches []string
// List of DNS options.
Options []string
}

0 comments on commit cebe997

Please sign in to comment.