Switch over to k8s notification API (#202)
* Merge notification code by @aledbf and update for recent changes. * Fix travis environment to correctly build with k8s.io and forked repositories. * Refactored kubernetes Corefile parser * Added lots of Corefile parsing tests
This commit is contained in:
parent
604d2a3730
commit
6d90b745e0
13 changed files with 609 additions and 237 deletions
|
@ -3,6 +3,9 @@ package util
|
|||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/client/cache"
|
||||
)
|
||||
|
||||
// StringInSlice check whether string a is a member of slice.
|
||||
|
@ -24,3 +27,16 @@ const (
|
|||
WildcardStar = "*"
|
||||
WildcardAny = "any"
|
||||
)
|
||||
|
||||
// StoreToNamespaceLister makes a Store that lists Namespaces.
|
||||
type StoreToNamespaceLister struct {
|
||||
cache.Store
|
||||
}
|
||||
|
||||
// List lists all Namespaces in the store.
|
||||
func (s *StoreToNamespaceLister) List() (ns api.NamespaceList, err error) {
|
||||
for _, m := range s.Store.List() {
|
||||
ns.Items = append(ns.Items, *(m.(*api.Namespace)))
|
||||
}
|
||||
return ns, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue