kubernetes-sigs / gateway-api

Repository for the next iteration of composite service (e.g. Ingress) and load balancing APIs.
https://gateway-api.sigs.k8s.io
Apache License 2.0
1.86k stars 482 forks source link

Question: why the older policy wins in GEP 713? #3434

Closed spacewander closed 2 weeks ago

spacewander commented 2 weeks ago

In https://github.com/kubernetes-sigs/gateway-api/blob/main/geps/gep-713/index.md#conflict-resolution:

The oldest Policy based on creation timestamp beats a newer one. For example, a Policy with a creation timestamp of "2021-07-15 01:02:03" MUST be given precedence over a Policy with a creation timestamp of "2021-07-15 01:02:04".

Naturally, newer is better. I'd like to know why the authors of GEP 713 designed a mechanism that the older policy will beat a newer one.

howardjohn commented 2 weeks ago

The intent, I believe, is so that a new policy doesn't break an existing one. A newer one is not better, because the new one, inherintly, isn't in use yet. Its far better to break something brand new than something existing. Breaking an existing rule can cause an outage, while breaking a new rule cannot break anything (since the old and new state is the same: the rule is not applied)

robscott commented 2 weeks ago

+1 to John's response. If anyone wants to make a corresponding docs update to make this clearer, it would be welcome.

spacewander commented 2 weeks ago

@howardjohn @robscott I have to submit a PR to add the reason: https://github.com/kubernetes-sigs/gateway-api/pull/3436, would you confirm if the sentences make this clearer? Thanks!