Пример #1
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_string_To_labels_Selector,
		Convert_string_To_fields_Selector,
		Convert_bool_ref_To_bool,
		Convert_bool_To_bool_ref,
		Convert_string_ref_To_string,
		Convert_string_To_string_ref,
		Convert_labels_Selector_To_string,
		Convert_fields_Selector_To_string,
		Convert_resource_Quantity_To_resource_Quantity,
	)
}
Пример #2
0
func (c *FakeEvents) GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector {
	action := GenericActionImpl{}
	action.Verb = "get-field-selector"
	action.Resource = "events"

	c.Fake.Invokes(action, nil)
	return fields.Everything()
}
Пример #3
0
func NewRootWatchAction(resource string, 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
}
Пример #4
0
func NewRootListAction(resource string, 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
}
Пример #5
0
func NewDeleteCollectionAction(resource, 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
}