aboutsummaryrefslogtreecommitdiff
path: root/middleware/kubernetes/util/util.go
diff options
context:
space:
mode:
authorGravatar Manuel Alejandro de Brito Fontes <aledbf@gmail.com> 2016-09-23 10:52:58 -0300
committerGravatar GitHub <noreply@github.com> 2016-09-23 10:52:58 -0300
commit7c105ee0378f7f23cfd9a632f6a2dc2880705a5e (patch)
treebc23ad7d745dfff69d4ba87f9c19be2ce9fd2b0f /middleware/kubernetes/util/util.go
parent090d1872e92b3becd198f92baa79869389212750 (diff)
parent8e6257c51f45c96f825a08ed28fae711a4082cc4 (diff)
downloadcoredns-7c105ee0378f7f23cfd9a632f6a2dc2880705a5e.tar.gz
coredns-7c105ee0378f7f23cfd9a632f6a2dc2880705a5e.tar.zst
coredns-7c105ee0378f7f23cfd9a632f6a2dc2880705a5e.zip
Merge pull request #283 from aledbf/k8s-util
Refactoring of k8s helpers
Diffstat (limited to 'middleware/kubernetes/util/util.go')
-rw-r--r--middleware/kubernetes/util/util.go42
1 files changed, 0 insertions, 42 deletions
diff --git a/middleware/kubernetes/util/util.go b/middleware/kubernetes/util/util.go
deleted file mode 100644
index 89cc2b592..000000000
--- a/middleware/kubernetes/util/util.go
+++ /dev/null
@@ -1,42 +0,0 @@
-// Package kubernetes/util provides helper functions for the kubernetes middleware
-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.
-func StringInSlice(a string, slice []string) bool {
- for _, b := range slice {
- if b == a {
- return true
- }
- }
- return false
-}
-
-// SymbolContainsWildcard checks whether symbol contains a wildcard value
-func SymbolContainsWildcard(symbol string) bool {
- return (strings.Contains(symbol, WildcardStar) || (symbol == WildcardAny))
-}
-
-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
-}