예제 #1
0
func addConversionFuncs(scheme *runtime.Scheme) {
	if err := scheme.AddFieldLabelConversionFunc("v1", "BackingServiceInstance",
		oapi.GetFieldLabelConversionFunc(backingserviceinstanceapi.BackingServiceInstanceToSelectableFields(&backingserviceinstanceapi.BackingServiceInstance{}), nil),
	); err != nil {
		panic(err)
	}
}
예제 #2
0
func getAttrs(obj runtime.Object) (objLabels labels.Set, objFields fields.Set, err error) {
	bsi, ok := obj.(*api.BackingServiceInstance)
	if !ok {
		return nil, nil, fmt.Errorf("not a BackingServiceInstance")
	}
	return labels.Set(bsi.Labels), api.BackingServiceInstanceToSelectableFields(bsi), nil
}
예제 #3
0
func TestFieldSelectorConversions(t *testing.T) {
	testutil.CheckFieldLabelConversions(t, "v1", "BackingServiceInstance",
		// Ensure all currently returned labels are supported
		api.BackingServiceInstanceToSelectableFields(&backingserviceinstanceapi.BackingServiceInstance{}),
		// Ensure previously supported labels have conversions. DO NOT REMOVE THINGS FROM THIS LIST
		"spec.provisioning.backingservice_name",
	)
}