karmada
karmada copied to clipboard
fix opensearch mapper_parsing_exception
karmada-search error log: Could not dynamically add mapping for field [app.name]. Existing mapping for [metadata.labels.app] must be of type object but found [text].
Co-authored-by: liys87x [email protected] Signed-off-by: huntsman_ly [email protected]
What type of PR is this? /kind bug
What this PR does / why we need it:
Which issue(s) this PR fixes: Fixes #2335
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Example of mapper_parsing_exception error generated under dynamic mapping
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx
name: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx:alpine
name: nginx
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.name: nginx1
name: nginx1
spec:
replicas: 3
selector:
matchLabels:
app.name: nginx1
template:
metadata:
labels:
app.name: nginx1
spec:
containers:
- image: nginx:alpine
name: nginx1
/cc @wuyingjun-lucky Can you help take a look and have a test?
OK, I will finish it this weekend. /assign
I have tested it works well on my side @XiShanYongYe-Chang.
I am not sure whether it will have an effect on query actions like labelselector if we change
flattened
to object
and set it to false although it seems we have not implement query actions on opensearch backend.
Leave it to you @liys87x @RainbowMango @XiShanYongYe-Chang.
opensearch does not support flattened
https://github.com/opensearch-project/OpenSearch/issues/1018
opensearch does not support
flattened
opensearch-project/OpenSearch#1018
OK looks good to me cc @XiShanYongYe-Chang
@wuyingjun-lucky Thanks a lot!
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: XiShanYongYe-Chang
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~pkg/search/OWNERS~~ [XiShanYongYe-Chang]
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment