code: func HasResource(res *api.GenericResource, resources []*api.GenericResource) bool {
  	for _, r := range resources {
  		if Kind(res) != Kind(r) {
  			continue
  		}
  
  		switch rtype := r.Resource.(type) {
  		case *api.GenericResource_DiscreteResourceSpec:
  			if res.GetDiscreteResourceSpec() == nil {
  				return false
  			}
  
  			if res.GetDiscreteResourceSpec().Value < rtype.DiscreteResourceSpec.Value {
  				return false
  			}
  
  			return true
  		case *api.GenericResource_NamedResourceSpec:
  			if res.GetNamedResourceSpec() == nil {
  				return false
  			}
  
  			if res.GetNamedResourceSpec().Value != rtype.NamedResourceSpec.Value {
  				continue
  			}
  
  			return true
  		}
  	}
  
  	return false
  }
docs: // HasResource checks if there is enough "res" in the "resources" argument