crossplane-contrib / crossplane-contrib/function-extra-resources

Empty Label Selector does not get propegated to crossplane

Open
#21 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Go
Stars
33
Forks
22
PR merge metrics
No merged PRs in 30d

Description

### What happened?

when setting an empty labelSelector

```yaml
extraResources:
- kind: EnvironmentConfig
into: envConfs
apiVersion: apiextensions.crossplane.io/v1alpha1
type: Selector
selector:
maxMatch: 2
minMatch: 1
matchLabels: []
```
does not propagete an empty labelSelector to crossplane. instead omitting it altogether.

empty LabelSelectors imply they should match everything.
from [api docs](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/):
> A selector to restrict the list of returned objects by their labels. Defaults to everything.

### How can we reproduce it?
replace
```yaml
matchLabels:
- key: type
type: Value
value: cluster
```
with
```yaml
matchLabels: []
```
in `example/composition.yaml`

### What environment did it happen in?
Function version: v0.0.3
Crossplane 1.16.0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.