mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 04:32:37 +00:00
allow dots in config set
This commit is contained in:
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package util
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"sort"
|
||||
)
|
||||
|
||||
@@ -32,6 +33,18 @@ func NewStringSet(items ...string) StringSet {
|
||||
return ss
|
||||
}
|
||||
|
||||
// KeySet creates a StringSet from a keys of a map[string](? extends interface{}). Since you can't describe that map type in the Go type system
|
||||
// the reflected value is required.
|
||||
func KeySet(theMap reflect.Value) StringSet {
|
||||
ret := StringSet{}
|
||||
|
||||
for _, keyValue := range theMap.MapKeys() {
|
||||
ret.Insert(keyValue.String())
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
// Insert adds items to the set.
|
||||
func (s StringSet) Insert(items ...string) {
|
||||
for _, item := range items {
|
||||
|
Reference in New Issue
Block a user