Address comments.
This commit is contained in:
@@ -14,6 +14,6 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package daemon provides Registry interface and it's RESTStorage
|
||||
// Package daemon provides Registry interface and its RESTStorage
|
||||
// implementation for storing Daemon api objects.
|
||||
package daemon
|
||||
|
@@ -543,28 +543,11 @@ func TestEtcdWatchControllersFields(t *testing.T) {
|
||||
|
||||
testFieldMap := map[int][]fields.Set{
|
||||
PASS: {
|
||||
{"status.currentNumberScheduled": "2"},
|
||||
{"status.numberMisscheduled": "1"},
|
||||
{"status.desiredNumberScheduled": "4"},
|
||||
{"metadata.name": "foo"},
|
||||
{"status.currentNumberScheduled": "2", "status.numberMisscheduled": "1"},
|
||||
{"status.currentNumberScheduled": "2", "status.desiredNumberScheduled": "4"},
|
||||
{"status.currentNumberScheduled": "2", "metadata.name": "foo"},
|
||||
{"status.desiredNumberScheduled": "4", "metadata.name": "foo"},
|
||||
{"status.currentNumberScheduled": "2", "status.desiredNumberScheduled": "4", "metadata.name": "foo"},
|
||||
{"status.currentNumberScheduled": "2", "status.numberMisscheduled": "1", "status.desiredNumberScheduled": "4"},
|
||||
{"status.currentNumberScheduled": "2", "status.numberMisscheduled": "1", "status.desiredNumberScheduled": "4", "metadata.name": "foo"},
|
||||
},
|
||||
FAIL: {
|
||||
{"status.currentNumberScheduled": "1"},
|
||||
{"status.numberMisscheduled": "0"},
|
||||
{"status.desiredNumberScheduled": "5"},
|
||||
{"metadata.name": "bar"},
|
||||
{"name": "foo"},
|
||||
{"status.replicas": "0"},
|
||||
{"status.currentNumberScheduled": "2", "status.desiredNumberScheduled": "3"},
|
||||
{"status.numberMisscheduled": "3", "status.desiredNumberScheduled": "5"},
|
||||
{"status.currentNumberScheduled": "2", "status.desiredNumberScheduled": "4", "metadata.name": "foox"},
|
||||
},
|
||||
}
|
||||
testEtcdActions := []string{
|
||||
|
@@ -19,7 +19,6 @@ package daemon
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strconv"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/validation"
|
||||
@@ -92,17 +91,15 @@ func (daemonStrategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) f
|
||||
return append(validationErrorList, updateErrorList...)
|
||||
}
|
||||
|
||||
// AllowUnconditionalUpdate is the default update policy for daemon objects.
|
||||
func (daemonStrategy) AllowUnconditionalUpdate() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// DaemonToSelectableFields returns a label set that represents the object.
|
||||
// DaemonToSelectableFields returns a field set that represents the object.
|
||||
func DaemonToSelectableFields(daemon *api.Daemon) fields.Set {
|
||||
return fields.Set{
|
||||
"metadata.name": daemon.Name,
|
||||
"status.currentNumberScheduled": strconv.Itoa(daemon.Status.CurrentNumberScheduled),
|
||||
"status.numberMisscheduled": strconv.Itoa(daemon.Status.NumberMisscheduled),
|
||||
"status.desiredNumberScheduled": strconv.Itoa(daemon.Status.DesiredNumberScheduled),
|
||||
"metadata.name": daemon.Name,
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -273,7 +273,7 @@ func (e *Etcd) Update(ctx api.Context, obj runtime.Object) (runtime.Object, bool
|
||||
return nil, nil, err
|
||||
}
|
||||
if newVersion != version {
|
||||
return nil, nil, kubeerr.NewConflict(e.EndpointName, name, fmt.Errorf("the object has been modified; please apply your changes to the latest version and try again %+v, %+v", version, newVersion))
|
||||
return nil, nil, kubeerr.NewConflict(e.EndpointName, name, fmt.Errorf("the object has been modified; please apply your changes to the latest version and try again"))
|
||||
}
|
||||
}
|
||||
if err := rest.BeforeUpdate(e.UpdateStrategy, ctx, obj, existing); err != nil {
|
||||
|
Reference in New Issue
Block a user