// isRouteIngressValid determines if the RouteIngress has a host and that its conditions has an element with Type=RouteAdmitted and Status=ConditionTrue
519996
func isRouteIngressValid(routeIngress *routeapi.RouteIngress) bool {
	if len(routeIngress.Host) == 0 {
		return false
	}
	for _, condition := range routeIngress.Conditions {
		if condition.Type == routeapi.RouteAdmitted && condition.Status == corev1.ConditionTrue {
			return true
		}
	}
	return false
}
462450
func (m *MockAuthorizeRequester) IsRedirectURIValid() bool {
	ret := m.ctrl.Call(m, "IsRedirectURIValid")
	ret0, _ := ret[0].(bool)
	return ret0
}
1104323
func (p Path) IsValid() bool {
	if len(p.Path) < 1 {
		return false
	}

	for _, n := range p.Path {
		if !n.IsValid() {
			return false
		}
	}

	return true
}
654475
func (h Hash) IsValid() bool {
	if len(h.h) < MinHashByteLength {
		return false
	}
	if len(h.h) > MaxHashByteLength {
		return false
	}

	if h.hashType() == InvalidHash {
		return false
	}

	return true
}
385693
func (h hashPrefix) IsValid() bool {
	return len(h) >= minHashPrefixLength && len(h) <= maxHashPrefixLength
}
539056
func IsValidURL(name string, location string) error {
	_, err := url.Parse(location)
	if err != nil {
		return fmt.Errorf("%s is not a valid URL", location)
	}
	return nil
}
602126
func IsInvalidArgument(err error) bool {
	_, ok := Cause(err).(InvalidArgumentError)
	return ok
}
904439
func IsValidState(conn client.Connection, req StateRequest) (bool, error) {
	logger := plog.WithFields(log.Fields{
		"hostid":     req.HostID,
		"serviceid":  req.ServiceID,
		"instanceid": req.InstanceID,
	})

	basepth := "/"
	if req.PoolID != "" {
		basepth = path.Join("/pools", req.PoolID)
	}

	hspth := path.Join(basepth, "/hosts", req.HostID, "instances", req.StateID())
	if ok, err := conn.Exists(hspth); err != nil {

		logger.WithError(err).Debug("Could not look up host state")
		return false, &StateError{
			Request:   req,
			Operation: "exists",
			Message:   "could not look up host state",
		}
	} else if !ok {

		logger.Debug("Host state not found")
		return false, nil
	}

	logger.Debug("Found the host state")

	sspth := path.Join(basepth, "/services", req.ServiceID, req.StateID())
	if ok, err := conn.Exists(sspth); err != nil {
		logger.WithError(err).Debug("Could not look up service state")
		return false, &StateError{
			Request:   req,
			Operation: "exists",
			Message:   "could not look up service state",
		}
	} else if !ok {
		logger.Debug("Service state not found")
		return false, nil
	}

	cspth := path.Join(sspth, "current")
	if ok, err := conn.Exists(cspth); err != nil {
		logger.WithError(err).Debug("Could not look up current state (status)")
		return false, &StateError{
			Request:   req,
			Operation: "exists",
			Message:   "could not look up current state (status)",
		}
	} else if !ok {
		logger.Debug("Service status not found")
		return false, nil
	}

	logger.Debug("Found the service state")
	return true, nil
}
520263
func Convert_route_RouteIngress_To_v1_RouteIngress(in *route.RouteIngress, out *v1.RouteIngress, s conversion.Scope) error {
	return autoConvert_route_RouteIngress_To_v1_RouteIngress(in, out, s)
}
285128
func (r Route) Validate() error {
	if r.Domain.IsHTTP() {
		if r.Port.IsSet {
			return actionerror.InvalidHTTPRouteSettings{Domain: r.Domain.Name}
		}
		if r.Domain.IsShared() && r.Host == "" {
			return actionerror.NoHostnameAndSharedDomainError{}
		}
	} else { // Is TCP Domain
		if r.Host != "" || r.Path != "" {
			return actionerror.InvalidTCPRouteSettings{Domain: r.Domain.Name}
		}
	}
	return nil
}
468921
func (c *timeSeriesConfCache) IsValid() bool {
	return c.TimeSeriesConfs != nil && time.Since(c.Generated) < c.TTL
}
1355243
func (client *Client) CheckRoute(route Route) (bool, Warnings, error) {
	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.GetRouteReservedRequest,
		URIParams:   map[string]string{"domain_guid": route.DomainGUID},
	})
	if err != nil {
		return false, nil, err
	}

	queryParams := url.Values{}
	if route.Host != "" {
		queryParams.Add("host", route.Host)
	}
	if route.Path != "" {
		queryParams.Add("path", route.Path)
	}
	if route.Port.IsSet {
		queryParams.Add("port", fmt.Sprint(route.Port.Value))
	}
	request.URL.RawQuery = queryParams.Encode()

	var response cloudcontroller.Response
	err = client.connection.Make(request, &response)
	if _, ok := err.(ccerror.ResourceNotFoundError); ok {
		return false, response.Warnings, nil
	}

	return response.HTTPResponse.StatusCode == http.StatusNoContent, response.Warnings, err
}
710151
func (s *SetupClientSession) IsServerProofValid(proof []byte) bool {
	return s.session.VerifyServerAuthenticator(proof)
}
241335
func (po *Po) isValidLine(l string) bool {
	// Check prefix
	valid := []string{
		"\"",
		"msgctxt",
		"msgid",
		"msgid_plural",
		"msgstr",
	}

	for _, v := range valid {
		if strings.HasPrefix(l, v) {
			return true
		}
	}

	return false
}
217534
func isValidPeer(host *HostInfo) bool {
	return !(len(host.RPCAddress()) == 0 ||
		host.hostId == "" ||
		host.dataCenter == "" ||
		host.rack == "" ||
		len(host.tokens) == 0)
}
1364419
func ValidateFilterRuleValue(value string) error {
	for _, segment := range strings.Split(value, "/") {
		if segment == "." || segment == ".." {
			return &ErrInvalidFilterValue{value}
		}
	}

	if len(value) <= 1024 && utf8.ValidString(value) && !strings.Contains(value, `\`) {
		return nil
	}

	return &ErrInvalidFilterValue{value}
}
823080
func (v *VPCRouter) HasStaticRoutes() bool {
	return v.HasSetting() && v.Settings.Router.HasStaticRoutes()
}