Internal rename api.Minion -> api.Node
This commit is contained in:
@@ -550,7 +550,7 @@ func ValidateBoundPod(pod *api.BoundPod) (errors []error) {
|
||||
}
|
||||
|
||||
// ValidateMinion tests if required fields in the minion are set.
|
||||
func ValidateMinion(minion *api.Minion) errs.ValidationErrorList {
|
||||
func ValidateMinion(minion *api.Node) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
if len(minion.Namespace) != 0 {
|
||||
allErrs = append(allErrs, errs.NewFieldInvalid("namespace", minion.Namespace, ""))
|
||||
@@ -563,7 +563,7 @@ func ValidateMinion(minion *api.Minion) errs.ValidationErrorList {
|
||||
}
|
||||
|
||||
// ValidateMinionUpdate tests to make sure a minion update can be applied. Modifies oldMinion.
|
||||
func ValidateMinionUpdate(oldMinion *api.Minion, minion *api.Minion) errs.ValidationErrorList {
|
||||
func ValidateMinionUpdate(oldMinion *api.Node, minion *api.Node) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
oldMinion.Labels = minion.Labels
|
||||
if !reflect.DeepEqual(oldMinion, minion) {
|
||||
|
@@ -1077,7 +1077,7 @@ func TestValidateBoundPodNoName(t *testing.T) {
|
||||
func TestValidateMinion(t *testing.T) {
|
||||
validSelector := map[string]string{"a": "b"}
|
||||
invalidSelector := map[string]string{"NoUppercaseOrSpecialCharsLike=Equals": "b"}
|
||||
successCases := []api.Minion{
|
||||
successCases := []api.Node{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "abc",
|
||||
@@ -1100,7 +1100,7 @@ func TestValidateMinion(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
errorCases := map[string]api.Minion{
|
||||
errorCases := map[string]api.Node{
|
||||
"zero-length Name": {
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "",
|
||||
@@ -1134,45 +1134,45 @@ func TestValidateMinion(t *testing.T) {
|
||||
|
||||
func TestValidateMinionUpdate(t *testing.T) {
|
||||
tests := []struct {
|
||||
oldMinion api.Minion
|
||||
minion api.Minion
|
||||
oldMinion api.Node
|
||||
minion api.Node
|
||||
valid bool
|
||||
}{
|
||||
{api.Minion{}, api.Minion{}, true},
|
||||
{api.Minion{
|
||||
{api.Node{}, api.Node{}, true},
|
||||
{api.Node{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo"}},
|
||||
api.Minion{
|
||||
api.Node{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "bar"},
|
||||
}, false},
|
||||
{api.Minion{
|
||||
{api.Node{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
Labels: map[string]string{"foo": "bar"},
|
||||
},
|
||||
}, api.Minion{
|
||||
}, api.Node{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
Labels: map[string]string{"foo": "baz"},
|
||||
},
|
||||
}, true},
|
||||
{api.Minion{
|
||||
{api.Node{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
},
|
||||
}, api.Minion{
|
||||
}, api.Node{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
Labels: map[string]string{"foo": "baz"},
|
||||
},
|
||||
}, true},
|
||||
{api.Minion{
|
||||
{api.Node{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
Labels: map[string]string{"bar": "foo"},
|
||||
},
|
||||
}, api.Minion{
|
||||
}, api.Node{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
Labels: map[string]string{"foo": "baz"},
|
||||
|
Reference in New Issue
Block a user