mirror of https://github.com/kubernetes/kops.git
- adding a validation check on the deviceName for the additional volumes
- locking the feature down to aws only for now
This commit is contained in:
parent
bf69871a8b
commit
1774ce5861
|
|
@ -88,6 +88,12 @@ func ValidateInstanceGroup(g *kops.InstanceGroup) error {
|
|||
}
|
||||
}
|
||||
|
||||
for i, x := range g.Spec.Volumes {
|
||||
if x.DeviceName == nil {
|
||||
return field.Invalid(field.NewPath("volumes").Index(i).Child("deviceName"), "", "volume must have a device name")
|
||||
}
|
||||
}
|
||||
|
||||
if err := validateInstanceProfile(g.Spec.IAM, field.NewPath("iam")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
package validation
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"strings"
|
||||
|
|
@ -801,6 +802,12 @@ func DeepValidate(c *kops.Cluster, groups []*kops.InstanceGroup, strict bool) er
|
|||
if len(errs) != 0 {
|
||||
return errs[0]
|
||||
}
|
||||
default:
|
||||
for _, x := range groups {
|
||||
if len(x.Spec.Volumes) > 0 {
|
||||
return errors.New("instancegroup volumes are only available with aws at present")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue