Fix listing nodes in scheduler

This commit is contained in:
Wojciech Tyczynski
2015-04-15 14:01:36 +02:00
parent da999e0ff1
commit afb94c43b1
7 changed files with 26 additions and 206 deletions

View File

@@ -250,8 +250,9 @@ func (r *Request) RequestURI(uri string) *Request {
const (
// A constant that clients can use to refer in a field selector to the object name field.
// Will be automatically emitted as the correct name for the API version.
ObjectNameField = "metadata.name"
PodHost = "spec.host"
NodeUnschedulable = "spec.unschedulable"
ObjectNameField = "metadata.name"
PodHost = "spec.host"
)
type clientFieldNameToAPIVersionFieldName map[string]string
@@ -294,10 +295,12 @@ func (v versionToResourceToFieldMapping) filterField(apiVersion, resourceType, f
var fieldMappings = versionToResourceToFieldMapping{
"v1beta1": resourceTypeToFieldMapping{
"nodes": clientFieldNameToAPIVersionFieldName{
ObjectNameField: "name",
ObjectNameField: "name",
NodeUnschedulable: "unschedulable",
},
"minions": clientFieldNameToAPIVersionFieldName{
ObjectNameField: "name",
ObjectNameField: "name",
NodeUnschedulable: "unschedulable",
},
"pods": clientFieldNameToAPIVersionFieldName{
PodHost: "DesiredState.Host",
@@ -305,10 +308,12 @@ var fieldMappings = versionToResourceToFieldMapping{
},
"v1beta2": resourceTypeToFieldMapping{
"nodes": clientFieldNameToAPIVersionFieldName{
ObjectNameField: "name",
ObjectNameField: "name",
NodeUnschedulable: "unschedulable",
},
"minions": clientFieldNameToAPIVersionFieldName{
ObjectNameField: "name",
ObjectNameField: "name",
NodeUnschedulable: "unschedulable",
},
"pods": clientFieldNameToAPIVersionFieldName{
PodHost: "DesiredState.Host",
@@ -316,10 +321,12 @@ var fieldMappings = versionToResourceToFieldMapping{
},
"v1beta3": resourceTypeToFieldMapping{
"nodes": clientFieldNameToAPIVersionFieldName{
ObjectNameField: "metadata.name",
ObjectNameField: "metadata.name",
NodeUnschedulable: "spec.unschedulable",
},
"minions": clientFieldNameToAPIVersionFieldName{
ObjectNameField: "metadata.name",
ObjectNameField: "metadata.name",
NodeUnschedulable: "spec.unschedulable",
},
"pods": clientFieldNameToAPIVersionFieldName{
PodHost: "spec.host",