forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.go
30 lines (21 loc) · 946 Bytes
/
node.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package validation
import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/fielderrors"
"github.com/openshift/origin/pkg/cmd/server/api"
)
func ValidateNodeConfig(config *api.NodeConfig) fielderrors.ValidationErrorList {
allErrs := fielderrors.ValidationErrorList{}
if len(config.NodeName) == 0 {
allErrs = append(allErrs, fielderrors.NewFieldRequired("nodeName"))
}
allErrs = append(allErrs, ValidateServingInfo(config.ServingInfo).Prefix("servingInfo")...)
allErrs = append(allErrs, ValidateKubeConfig(config.MasterKubeConfig, "masterKubeConfig")...)
if len(config.DNSIP) > 0 {
allErrs = append(allErrs, ValidateSpecifiedIP(config.DNSIP, "dnsIP")...)
}
allErrs = append(allErrs, ValidateImageConfig(config.ImageConfig).Prefix("imageConfig")...)
if config.PodManifestConfig != nil {
allErrs = append(allErrs, ValidatePodManifestConfig(config.PodManifestConfig).Prefix("podManifestConfig")...)
}
return allErrs
}