Skip to content

Commit

Permalink
Merge pull request kubernetes#5220 from nikhiljindal/camelCaseFieldSe…
Browse files Browse the repository at this point in the history
…lectors

Changing v1beta3 field selectors to be camelCased
  • Loading branch information
bgrant0607 committed Mar 10, 2015
2 parents 482e673 + 916ca9c commit 6062e14
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions pkg/api/v1beta1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -1355,12 +1355,12 @@ func init() {
case "name":
return "name", value, nil
case "DesiredState.Host":
return "Status.Host", value, nil
return "status.host", value, nil
case "DesiredState.Status":
podStatus := PodStatus(value)
var internalValue newer.PodPhase
newer.Scheme.Convert(&podStatus, &internalValue)
return "Status.Phase", string(internalValue), nil
return "status.phase", string(internalValue), nil
default:
return "", "", fmt.Errorf("field label not supported: %s", label)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/v1beta2/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -1271,12 +1271,12 @@ func init() {
case "name":
return "name", value, nil
case "DesiredState.Host":
return "Status.Host", value, nil
return "status.host", value, nil
case "DesiredState.Status":
podStatus := PodStatus(value)
var internalValue newer.PodPhase
newer.Scheme.Convert(&podStatus, &internalValue)
return "Status.Phase", string(internalValue), nil
return "status.phase", string(internalValue), nil
default:
return "", "", fmt.Errorf("field label not supported: %s", label)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/v1beta3/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ func init() {
switch label {
case "name":
fallthrough
case "Status.Phase":
case "status.phase":
fallthrough
case "Status.Host":
case "status.host":
return label, value, nil
default:
return "", "", fmt.Errorf("field label not supported: %s", label)
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/cache/listwatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func getHostFieldLabel() string {
case "v1beta1", "v1beta2":
return "DesiredState.Host"
default:
return "Status.Host"
return "status.host"
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/config/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ func getHostFieldLabel(apiVersion string) string {
case "v1beta1", "v1beta2":
return "DesiredState.Host"
default:
return "Status.Host"
return "status.host"
}
}
8 changes: 4 additions & 4 deletions pkg/registry/pod/etcd/etcd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,16 +337,16 @@ func TestListPodListSelection(t *testing.T) {
label: "label=qux",
expectedIDs: util.NewStringSet("qux"),
}, {
field: "Status.Phase=Failed",
field: "status.phase=Failed",
expectedIDs: util.NewStringSet("baz"),
}, {
field: "Status.Host=barhost",
field: "status.host=barhost",
expectedIDs: util.NewStringSet("bar"),
}, {
field: "Status.Host=",
field: "status.host=",
expectedIDs: util.NewStringSet("foo", "baz", "qux", "zot"),
}, {
field: "Status.Host!=",
field: "status.host!=",
expectedIDs: util.NewStringSet("bar"),
},
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/registry/pod/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ func MatchPod(label, field labels.Selector) generic.Matcher {
func PodToSelectableFields(pod *api.Pod) labels.Set {
return labels.Set{
"name": pod.Name,
"Status.Phase": string(pod.Status.Phase),
"Status.Host": pod.Status.Host,
"status.phase": string(pod.Status.Phase),
"status.host": pod.Status.Host,
}
}

Expand Down
2 changes: 1 addition & 1 deletion plugin/pkg/scheduler/factory/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func getHostFieldLabel(apiVersion string) string {
case "v1beta1", "v1beta2":
return "DesiredState.Host"
default:
return "Status.Host"
return "status.host"
}
}

Expand Down

0 comments on commit 6062e14

Please sign in to comment.