Merge pull request #5971 from bprashanth/rc_watch_fields

Add the ability to watch fields of a replication controller
This commit is contained in:
Piotr Szczesniak
2015-03-27 10:19:41 +01:00
6 changed files with 153 additions and 7 deletions

View File

@@ -1514,6 +1514,21 @@ func init() {
// If one of the conversion functions is malformed, detect it immediately.
panic(err)
}
err = newer.Scheme.AddFieldLabelConversionFunc("v1beta1", "replicationControllers",
func(label, value string) (string, string, error) {
switch label {
case "name":
return "name", value, nil
case "currentState.replicas":
return "status.replicas", value, nil
default:
return "", "", fmt.Errorf("field label not supported: %s", label)
}
})
if err != nil {
// If one of the conversion functions is malformed, detect it immediately.
panic(err)
}
err = newer.Scheme.AddFieldLabelConversionFunc("v1beta1", "events",
func(label, value string) (string, string, error) {
switch label {

View File

@@ -1440,6 +1440,21 @@ func init() {
// If one of the conversion functions is malformed, detect it immediately.
panic(err)
}
err = newer.Scheme.AddFieldLabelConversionFunc("v1beta2", "replicationControllers",
func(label, value string) (string, string, error) {
switch label {
case "name":
return "name", value, nil
case "currentState.replicas":
return "status.replicas", value, nil
default:
return "", "", fmt.Errorf("field label not supported: %s", label)
}
})
if err != nil {
// If one of the conversion functions is malformed, detect it immediately.
panic(err)
}
err = newer.Scheme.AddFieldLabelConversionFunc("v1beta2", "events",
func(label, value string) (string, string, error) {
switch label {

View File

@@ -39,6 +39,21 @@ func init() {
// If one of the conversion functions is malformed, detect it immediately.
panic(err)
}
err = newer.Scheme.AddFieldLabelConversionFunc("v1beta3", "replicationControllers",
func(label, value string) (string, string, error) {
switch label {
case "name":
return "name", value, nil
case "status.replicas":
return "status.replicas", value, nil
default:
return "", "", fmt.Errorf("field label not supported: %s", label)
}
})
if err != nil {
// If one of the conversion functions is malformed, detect it immediately.
panic(err)
}
err = newer.Scheme.AddFieldLabelConversionFunc("v1beta3", "events",
func(label, value string) (string, string, error) {
switch label {