Octops / gameserver-ingress-controller

Automatic Ingress configuration for Game Servers managed by Agones
https://octops.io
Apache License 2.0
68 stars 9 forks source link

Support templating for custom annotations #32

Closed danieloliveira079 closed 2 years ago

danieloliveira079 commented 2 years ago

This PR delivers support for custom annotations to be rendered using templates.

This feature is specially useful if the routing mode is path. Envoy will only enable websocket for routes that match exactly the path set on the Ingress rules.

The example below demonstrates how custom annotations using template would be generated for a game server named octops-tl6hf-fnmgd.

Custom Annotation: octops-projectcontour.io/websocket-routes: /{{ .Name }} Final Annotation: octops-projectcontour.io/websocket-routes: /octops-tl6hf-fnmgd

The same applies for any other custom annotation. In the future more fields will be added but now .Name is the only one supported.

xxtanisxx commented 2 years ago

This is going to be amazing!