1
0
mirror of https://github.com/rancher/types.git synced 2025-09-16 23:08:25 +00:00

Update ToInternal

This commit is contained in:
Darren Shepherd
2018-06-04 21:44:54 -07:00
parent 7c20e28b3c
commit 986f420630
19 changed files with 62 additions and 32 deletions

View File

@@ -192,7 +192,7 @@ func StringsToNodeSelectorTerm(exprs []string) []v1.NodeSelectorTerm {
return result
}
func (s SchedulingMapper) ToInternal(data map[string]interface{}) {
func (s SchedulingMapper) ToInternal(data map[string]interface{}) error {
defer func() {
delete(data, "scheduling")
}()
@@ -208,7 +208,7 @@ func (s SchedulingMapper) ToInternal(data map[string]interface{}) {
if len(requireAll) == 0 && len(requireAny) == 0 && len(preferred) == 0 {
values.PutValue(data, nil, "affinity", "nodeAffinity")
return
return nil
}
nodeAffinity := v1.NodeAffinity{}
@@ -253,6 +253,8 @@ func (s SchedulingMapper) ToInternal(data map[string]interface{}) {
}
data["affinity"] = affinity
return nil
}
func AggregateTerms(terms []v1.NodeSelectorTerm) v1.NodeSelectorTerm {