openstack-k8s-operators / openstack-operator

Meta Operator for OpenStack
https://openstack-k8s-operators.github.io/openstack-operator/
Apache License 2.0
30 stars 77 forks source link

Enable HSTS on OCP route #819

Closed bshephar closed 5 months ago

bshephar commented 5 months ago

This change adds the required annotation to the OCP route to enable HSTS headers as per: https://access.redhat.com/documentation/en-us/openshift_container_platform/4.7/html/networking/configuring-routes\#nw-enabling-hsts_route-configuration

Resolves: https://issues.redhat.com/browse/OSPRH-7367

bshephar commented 5 months ago

I'm not a massive fan of updating Spec sections outside of webhooks. But given that we don't have anything else using webhooks to modify the OSCP, I'm inclined to avoid additional webhook logic just for this use case. Happy to take alternative suggestions on putting this elsewhere? Else, we can stick with it for now and move it later.

softwarefactory-project-zuul[bot] commented 5 months ago

Build failed (check pipeline). Post recheck (without leading slash) to rerun all jobs. Make sure the failure cause has been resolved before you rerun jobs.

https://review.rdoproject.org/zuul/buildset/e422f51405d54e1aa7b765ca1bd1eaca

:heavy_check_mark: openstack-k8s-operators-content-provider SUCCESS in 1h 41m 51s :heavy_check_mark: podified-multinode-edpm-deployment-crc SUCCESS in 1h 20m 07s :heavy_check_mark: cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 23m 25s :x: openstack-operator-tempest-multinode FAILURE in 1h 24m 42s

gibizer commented 5 months ago

Yeah, I don't see another way to achieve this today.

There is a possible direction in the future: The horizon-operator adds annotation to the service https://github.com/openstack-k8s-operators/horizon-operator/blob/9d2609bb0015818c7eb07a207f5942817c2273c3/controllers/horizon_controller.go#L4[…]412 and the openstack-operator reads them to make decision about the route creation https://github.com/openstack-k8s-operators/openstack-operator/blob/aa91068ef71b267cc9a77cb8950d670a2e292d7b/pkg/openstack/common.go#L232-L233 So I think this channel could be extended to pass extra annotations up to the route created. But I hope @stuggi knows more.

openshift-ci[bot] commented 5 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bshephar, dprince, gibizer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/openstack-k8s-operators/openstack-operator/blob/main/OWNERS)~~ [dprince] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment