-
Spike
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
False
-
None
-
False
-
OCPSTRAT-924 - Console: Customer Happiness (RFEs) for 4.16
-
-
-
HAC Infra OCP - Sprint 249
Customer uses Gatekeeper to implement policies in a ValidatingWebhookConfiguration and each policy can either be a warning policy or a deny policy. The warning messages shown/generated only are visible when using the `oc cli`, and they are not visible from the console. Doing the same in the console will just update the resource with no message. The request should still be allowed through, but in the view of the customer, a way to notify the user that they violated a warn policy would be helpful.
Slack thread - https://redhat-internal.slack.com/archives/C6A3NV5J9/p1689862224796089
For example:
#oc edit scaledobject example Warning: [block-unsupported-keda-scaler] ScaledObject example spec.triggers[1]: unsupported scaler type external scaledobject.keda.sh/example edited
AC:
- Figure out how the warning is sent, if part of the response msg directly or there is a different mechanism (eg. check how CLI is handling this):
The warning is in the HTTP Response Header. See attached screenshot. - Identify what are the components which need to be updated to these warnings:
- consoleFetch - Currently does not support HTTP `response.headers`
- K8s resource functions i.e. K8sCreate, K8sUpdate, K8sPatch
- Store the warning policy response in Redux state or use React Context
- Update types for the above
- Create a follow up story/ies:
1. Add support for retrieving response.header in consoleFetchCommon function https://issues.redhat.com/browse/CONSOLE-3949
2. Display a warning notification from kube-apiserver when creating a resource in Console UI story-
https://issues.redhat.com/browse/CONSOLE-3939
3. Display a warning notification from kube-apiserver when updating a resource in Console UI story-
https://issues.redhat.com/browse/CONSOLE-3942
4. Display warning notifications from kube-apiserver when creating bulk resources in Console UI
https://issues.redhat.com/browse/CONSOLE-3954
Additional info:
- Add `response.headers.get('Warning')` to `consoleFetchCommon` function, and extract both JSON and headers from `consoleFetchCommon`.
Observation: The console resource response returns a string, and the `.text()` is used to extract the actual text response. We'll have to figure out how to return `response.headers` along `response.text()` in this case which would likely involve changes down the line. - The UX team have provided designs for notification. See the follow-up stories
- See attached screenshots for screens redirected to after create or update actions where
the notification should be displayed
- is related to
-
RFE-4477 Configure OpenShift Console to display warnings from apiserver when creating/updating resources
- Accepted