kubernetes-sigs / application

Application metadata descriptor CRD
Apache License 2.0
513 stars 167 forks source link

[BUG] MatchExpressions is ignored on ApplicationSpec.Selector #216

Closed bandesz closed 3 years ago

bandesz commented 3 years ago

What

I was trying to use MatchExpressions in ApplicationSpec.Selector but it wasn't working, e.g. my Application object did pick up all Deployment objects - including from other applications in the same namespace.

I have to use MatchExpressions, as the 3rd-party Helm chart I'm deploying tags all deployments with a different app.kubernetes.io/name label.

In my case I would need to use this:

selector:
  matchExpressions:
    - key: app.kubernetes.io/name
      operator: In
      values:
        - calico-typha
        - calico-typha-autoscaler

Even if you don't want to support MatchExpressions, this is clearly a bug, as nothing stops you using it but it doesn't work as one would expect.

I think this project should support MatchExpressions, as although identifying an application with a single label is best practice, nothing guarantees that 3rd-party software do follow it.

bandesz commented 3 years ago

I fixed this in our fork: https://github.com/appvia/kubernetes-sigs-application/commit/9c75b492717d9d1953dc6c02a792ba099d764ae0, let me know if you would like me to open a PR. I tested the fork successfully in a real environment.

The fork is created from v0.8.3 as master seems to be broken currently (the built Docker image errors complaining about a missing "LeaderElectionId")

fejta-bot commented 3 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale

fejta-bot commented 3 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten

k8s-triage-robot commented 3 years ago

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-contributor-experience at kubernetes/community. /close

k8s-ci-robot commented 3 years ago

@k8s-triage-robot: Closing this issue.

In response to [this](https://github.com/kubernetes-sigs/application/issues/216#issuecomment-894219787): >Rotten issues close after 30d of inactivity. >Reopen the issue with `/reopen`. >Mark the issue as fresh with `/remove-lifecycle rotten`. > >Send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.