Bug 2074243

Summary: DefaultPlacement API allow empty enum value and remove default
Product: OpenShift Container Platform Reporter: Omer Tuchfeld <otuchfel>
Component: NetworkingAssignee: aos-network-edge-staff <aos-network-edge-staff>
Networking sub component: router QA Contact: Hongan Li <hongli>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: aos-bugs, mmasters, wking
Version: 4.11   
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 11:05:57 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 Omer Tuchfeld 2022-04-11 21:03:18 UTC
Description of problem:
The DefaultPlacement config status field should allow the "" value
to be used during an Update for this subresource. This should allow the
status subresource to be updated even when DefaultPlacement has an
empty value.

OpenShift release version:
4.11

Cluster Platform:
Any

How reproducible:
n/a

Steps to Reproduce (in detail):
1. n/a
2.
3.


Actual results:
Updating the ingress config status subresource is impossible while the `DefaultPlacement` field is empty

Expected results:
It should be possible

Impact of the problem:
Clusters which don't have this field set (because they were installed before the installer learnt how to set that field) cannot update the ingress config subresource

Additional info:
Also remove the kubebuilder:default:="Workers" specifier because the
controller already regards an empty value as "Workers", there's no
need for it to be explicitly set when omitted.


** Please do not disregard the report template; filling the template out as much as possible will allow us to help you. Please consider attaching a must-gather archive (via `oc adm must-gather`). Please review must-gather contents for sensitive information before attaching any must-gathers to a bugzilla report.  You may also mark the bug private if you wish.

Comment 1 Miciah Dashiel Butler Masters 2022-04-11 21:07:29 UTC
No docs update because the issue was introduced and will be fixed in the same release.

Comment 4 Hongan Li 2022-04-22 06:57:21 UTC
verified with 4.11.0-0.nightly-2022-04-21-192140 and `DefaultPlacement` field can be updated to empty by api access. 

# fresh installed cluster
$ oc get ingress.config cluster -ojson | jq '.status'
{
---<snip>---
  "defaultPlacement": "Workers"
}


# update the status by api access
curl -k -X PUT "$APISERVER/apis/config.openshift.io/v1/ingresses/cluster/status/" \
    -d $WITH_STATUS \
    --header "Authorization: Bearer $TOKEN" \
    --header "Content-Type: application/json"

$ oc get ingress.config cluster -ojson | jq '.status'
{
---<snip>---
  "defaultPlacement": ""
}

Comment 7 errata-xmlrpc 2022-08-10 11:05:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5069