Bug 1916578

Summary: HTTPHeaders setting in IngressController resource doesn't work expectedly
Product: OpenShift Container Platform Reporter: Catherine_H <yhuang>
Component: DocumentationAssignee: Jason Boxman <jboxman>
Status: CLOSED CURRENTRELEASE QA Contact: zhaozhanqi <zzhao>
Severity: low Docs Contact: Vikram Goyal <vigoyal>
Priority: medium    
Version: 4.6CC: aiyengar, amcdermo, aos-bugs, jokerman, trees
Target Milestone: ---   
Target Release: 4.6.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-06 03:30:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Catherine_H 2021-01-15 06:30:12 UTC
Description of problem:
HTTPHeaders setting in IngressController resource doesn't work expectedly

https://access.redhat.com/documentation/en-us/openshift_container_platform/4.6/html/networking/configuring-ingress#nw-using-ingress-forwarded_configuring-ingress

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Use the following command to edit the IngressController resource:
$ oc edit IngressController

2. Add httpHeaders related settings
apiVersion: operator.openshift.io/v1
kind: IngressController
metadata:
  name: default
  namespace: openshift-ingress-operator
spec:
  httpHeaders:            # <-- added
    forwarded:            # <-- added
      policy: append            # <-- added

3. Save

Actual results:

The setting wasn't applied properly:

spec:
  httpHeaders: {}

Expected results:

httpHeaders related settings works properly

Additional info:

Comment 1 Arvind iyengar 2021-01-15 08:04:50 UTC
For modifying the "httpHeader" the recommended way would be setting in the below way:
------
spec:
  httpHeaders:
    forwardedHeaderPolicy: Append 
------
This parameter will take "Replace/ IfNone / Never" options. Kindly try to set the forwarded option in the above way and check whether it helps.

Comment 2 Catherine_H 2021-01-15 08:42:58 UTC
Hi Arvind,

Thanks for your kind reply.

I tested with below way and it's worked! :)

------
spec:
  httpHeaders:
    forwardedHeaderPolicy: Append 
------

Maybe the documentation should be fixed accordingly?

Comment 4 Jason Boxman 2021-02-11 18:44:47 UTC
To correct this, I've opened a minor PR[0].

Thanks.

[0] https://github.com/openshift/openshift-docs/pull/29429