Headless Services: Adding option to specify None for PortalIP

This commit is contained in:
Abhishek Gupta
2015-03-16 14:36:30 -07:00
parent 7f02e110f4
commit b0c23c1046
16 changed files with 237 additions and 16 deletions

View File

@@ -84,3 +84,14 @@ func IsStandardResourceName(str string) bool {
func NewDeleteOptions(grace int64) *DeleteOptions {
return &DeleteOptions{GracePeriodSeconds: &grace}
}
// this function aims to check if the service portal IP is set or not
// the objective is not to perform validation here
func IsServiceIPSet(service *Service) bool {
return service.Spec.PortalIP != PortalIPNone && service.Spec.PortalIP != ""
}
// this function aims to check if the service portal IP is requested or not
func IsServiceIPRequested(service *Service) bool {
return service.Spec.PortalIP == ""
}