func (c *FakeEvents) GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector {
	action := testing.GenericActionImpl{}
	action.Verb = "get-field-selector"
	action.Resource = eventsResource

	c.Fake.Invokes(action, nil)
	return fields.Everything()
}
Esempio n. 2
0
func listIngresss(namespace, labelKey, labelValue string) (*v1beta1.IngressList, error) {
	selector := labels.Set{labelKey: labelValue}.AsSelector()
	listOptions := api.ListOptions{FieldSelector: fields.Everything(), LabelSelector: selector}
	list, err := client.Ingresses(namespace).List(listOptions)

	if err != nil {
		log.Println("[listIngresss] Error listing Ingresss", err)
		return nil, err
	}
	return list, nil
}
func listReplicationControllers(namespace, labelKey, labelValue string) (*v1.ReplicationControllerList, error) {
	selector := labels.Set{labelKey: labelValue}.AsSelector()
	listOptions := api.ListOptions{FieldSelector: fields.Everything(), LabelSelector: selector}
	list, err := client.Core().ReplicationControllers(namespace).List(listOptions)

	if err != nil {
		log.Println("[listReplicationControllers] Error listing replicationControllers", err)
		return nil, err
	}
	return list, nil
}
Esempio n. 4
0
func addDefaultingFuncs(scheme *runtime.Scheme) error {
	return scheme.AddDefaultingFuncs(
		func(obj *ListOptions) {
			if obj.LabelSelector == nil {
				obj.LabelSelector = labels.Everything()
			}
			if obj.FieldSelector == nil {
				obj.FieldSelector = fields.Everything()
			}
		},
	)
}
Esempio n. 5
0
func init() {
	Scheme.AddDefaultingFuncs(
		func(obj *ListOptions) {
			if obj.LabelSelector == nil {
				obj.LabelSelector = labels.Everything()
			}
			if obj.FieldSelector == nil {
				obj.FieldSelector = fields.Everything()
			}
		},
	)
	Scheme.AddConversionFuncs(
		Convert_unversioned_TypeMeta_To_unversioned_TypeMeta,

		Convert_unversioned_ListMeta_To_unversioned_ListMeta,

		Convert_intstr_IntOrString_To_intstr_IntOrString,

		Convert_unversioned_Time_To_unversioned_Time,

		Convert_Slice_string_To_unversioned_Time,

		Convert_resource_Quantity_To_resource_Quantity,

		Convert_string_To_labels_Selector,
		Convert_labels_Selector_To_string,

		Convert_string_To_fields_Selector,
		Convert_fields_Selector_To_string,

		Convert_Pointer_bool_To_bool,
		Convert_bool_To_Pointer_bool,

		Convert_Pointer_string_To_string,
		Convert_string_To_Pointer_string,

		Convert_Pointer_int64_To_int,
		Convert_int_To_Pointer_int64,

		Convert_Pointer_int32_To_int32,
		Convert_int32_To_Pointer_int32,

		Convert_Pointer_float64_To_float64,
		Convert_float64_To_Pointer_float64,

		Convert_map_to_unversioned_LabelSelector,
		Convert_unversioned_LabelSelector_to_map,
	)
}
Esempio n. 6
0
func listServices(namespace, labelKey, labelValue string) (*v1.ServiceList, error) {
	selector := labels.Set{labelKey: labelValue}.AsSelector()
	listOptions := api.ListOptions{FieldSelector: fields.Everything(), LabelSelector: selector}
	list, err := client.Core().Services(namespace).List(listOptions)

	if err != nil {
		log.Println("[listServices] Error listing services", err)
		return nil, err
	}

	if len(list.Items) == 0 {
		log.Println("[listServices] No services could be found for namespace:", namespace, " labelKey: ", labelKey, " labelValue: ", labelValue)
	}

	return list, nil
}
Esempio n. 7
0
func NewRootListAction(resource unversioned.GroupVersionResource, opts api.ListOptions) ListActionImpl {
	action := ListActionImpl{}
	action.Verb = "list"
	action.Resource = resource
	labelSelector := opts.LabelSelector
	if labelSelector == nil {
		labelSelector = labels.Everything()
	}
	fieldSelector := opts.FieldSelector
	if fieldSelector == nil {
		fieldSelector = fields.Everything()
	}
	action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector}

	return action
}
Esempio n. 8
0
func NewRootWatchAction(resource unversioned.GroupVersionResource, opts api.ListOptions) WatchActionImpl {
	action := WatchActionImpl{}
	action.Verb = "watch"
	action.Resource = resource
	labelSelector := opts.LabelSelector
	if labelSelector == nil {
		labelSelector = labels.Everything()
	}
	fieldSelector := opts.FieldSelector
	if fieldSelector == nil {
		fieldSelector = fields.Everything()
	}
	action.WatchRestrictions = WatchRestrictions{labelSelector, fieldSelector, opts.ResourceVersion}

	return action
}
Esempio n. 9
0
func NewDeleteCollectionAction(resource unversioned.GroupVersionResource, namespace string, opts api.ListOptions) DeleteCollectionActionImpl {
	action := DeleteCollectionActionImpl{}
	action.Verb = "delete-collection"
	action.Resource = resource
	action.Namespace = namespace
	labelSelector := opts.LabelSelector
	if labelSelector == nil {
		labelSelector = labels.Everything()
	}
	fieldSelector := opts.FieldSelector
	if fieldSelector == nil {
		fieldSelector = fields.Everything()
	}
	action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector}

	return action
}
Esempio n. 10
0
func init() {
	labelMap := labels.Set{fmt.Sprintf("%s/routable", prefix): "true"}
	listOptions = api.ListOptions{LabelSelector: labelMap.AsSelector(), FieldSelector: fields.Everything()}
}