open-feature / open-feature-operator

A Kubernetes feature flag operator
https://openfeature.dev
Apache License 2.0
164 stars 33 forks source link

Support no host in ingress rules, minor default changes #656

Closed toddbaert closed 1 month ago

toddbaert commented 1 month ago

Our ingress CRD doesn't work if no hosts are supplied. This is because here, we iterate over the Hosts array and use that to build rules. The problem is that host is not a necessary property on an ingress - a nil host means it applies to all traffic.

From K8S doc:

An optional host. In this example, no host is specified, so the rule applies to all inbound HTTP traffic through the IP address specified. If a host is provided (for example, foo.bar.com), the rules apply to that host.

I really like the feel of this CRD (annotation support, a bunch of props that apply to all rules :sunglasses: ) but I think we need to find something else to iterate over or find some other way to do this so that we can support host-less rules. This can be breaking since this is a such a new CRD.

Happy to be wrong on this one, but I think this is a bit of a limitation.

toddbaert commented 1 month ago

This can be handle with a an empty string.

I've added doc for this here: https://github.com/open-feature/open-feature-operator/pull/659