Repository: kubernetes
Issue: [Bug] The "managedFields" field in abnormal state after applying resources
Labels: kind/bug,sig/api-machinery,triage/accepted

### What happened?

After performing the `kubectl apply app.yaml --server-side --force-conflicts` on the server side, the "managedFields" information appears to be missing.

The normal case should be 
```yaml
# k get svc haproxy-nlb-jfg-0 --show-managed-fields=true  -o yaml | yq .metadata.managedFields
- apiVersion: v1
  fieldsType: FieldsV1
  fieldsV1:
    f:metadata:
      f:annotations:
        f:dns.gardener.cloud/class: {}
        f:dns.gardener.cloud/dnsnames: {}
        f:dns.gardener.cloud/ttl: {}
        f:service.beta.kubernetes.io/aws-load-balancer-type: {}
        f:service.beta.kubernetes.io/azure-load-balancer-health-probe-interval: {}
        f:service.beta.kubernetes.io/azure-load-balancer-health-probe-num-of-probe: {}
        f:service.beta.kubernetes.io/azure-load-balancer-tcp-idle-timeout: {}
      f:labels:
        f:app: {}
        f:run: {}
        f:runAzSpecific: {}
    f:spec:
      f:externalTrafficPolicy: {}
      f:ports:
        k:{"port":443,"protocol":"TCP"}:
          .: {}
          f:name: {}
          f:port: {}
          f:protocol: {}
          f:targetPort: {}
      f:selector: {}
      f:type: {}
  manager: kubectl
  operation: Apply
- apiVersion: v1
  fieldsType: FieldsV1
  fieldsV1:
    f:metadata:
      f:annotations:
        f:kubectl.kubernetes.io/last-applied-configuration: {}
  manager: kubectl-last-applied
  operation: Apply
- apiVersion: v1
  fieldsType: FieldsV1
  fieldsV1:
    f:metadata:
      f:finalizers:
        .: {}
        v:"garden.dns.gardener.cloud/service-dns": {}
  manager: dns-controller-manager
  operation: Update
  time: "2021-07-17T14:00:52Z"
- apiVersion: v1
  fieldsType: FieldsV1
  fieldsV1:
    f:metadata:
      f:annotations:
        .: {}
        f:dns.gardener.cloud/class: {}
        f:dns.gardener.cloud/ttl: {}
        f:service.beta.kubernetes.io/aws-load-balancer-type: {}
        f:service.beta.kubernetes.io/azure-load-balancer-tcp-idle-timeout: {}
      f:labels:
        .: {}
        f:run: {}
        f:runAzSpecific: {}
    f:spec:
      f:externalTrafficPolicy: {}
      f:ports:
        .: {}
        k:{"port":443,"protocol":"TCP"}:
          .: {}
          f:name: {}
          f:port: {}
          f:protocol: {}
          f:targetPort: {}
      f:selector: {}
      f:sessionAffinity: {}
      f:type: {}
  manager: kubectl
  operation: Update
  time: "2021-07-17T14:00:52Z"
- apiVersion: v1
  fieldsType: FieldsV1
  fieldsV1:
    f:metadata:
      f:finalizers:
        v:"service.kubernetes.io/load-balancer-cleanup": {}
  manager: azure-cloud-controller-manager
  operation: Update
  time: "2021-07-17T14:01:42Z"
- apiVersion: v1
  fieldsType: FieldsV1
  fieldsV1:
    f:metadata:
      f:finalizers:
        v:"azure.remedy.gardener.cloud/service": {}
  manager: remedy-controller-azure
  operation: Update
  time: "2021-07-17T14:01:42Z"
- apiVersion: v1
  fieldsType: FieldsV1
  fieldsV1:
    f:metadata:
      f:annotations:
        f:service.beta.kubernetes.io/azure-load-balancer-ipv4: {}
        f:service.beta.kubernetes.io/azure-load-balancer-resource-group: {}
    f:spec:
      f:loadBalancerIP: {}
  manager: static-ip-distributor
  operation: Update
  time: "2023-04-29T12:22:30Z"
- apiVersion: v1
  fieldsType: FieldsV1
  fieldsV1:
    f:status:
      f:loadBalancer:
        f:ingress: {}
  manager: cloud-controller-manager
  operation: Update
  subresource: status
  time: "2023-04-29T12:23:03Z"
```

but after templating and applying the YAML resource file, the service has been changed as below:

```yaml
# k -n haproxy-ingress  get svc haproxy-nlb --show-managed-fields=true  -o yaml | yq .metadata.managedFields
- apiVersion: v1
  fieldsType: FieldsV1
  fieldsV1:
    f:metadata:
      f:annotations:
        f:kubectl.kubernetes.io/last-applied-configuration: {}
  manager: kubectl-last-applied
  operation: Apply
- apiVersion: v1
  fieldsType: FieldsV1
  fieldsV1:
    f:metadata:
      f:annotations:
        f:dns.gardener.cloud/class: {}
        f:dns.gardener.cloud/dnsnames: {}
        f:dns.gardener.cloud/ttl: {}
        f:service.beta.kubernetes.io/aws-load-balancer-type: {}
        f:service.beta.kubernetes.io/azure-load-balancer-health-probe-interval: {}
        f:service.beta.kubernetes.io/azure-load-balancer-health-probe-num-of-probe: {}
        f:service.beta.kubernetes.io/azure-load-balancer-tcp-idle-timeout: {}
      f:labels:
        f:run: {}
    f:spec:
      f:externalTrafficPolicy: {}
      f:ports:
        k:{"port":443,"protocol":"TCP"}:
          .: {}
          f:name: {}
          f:port: {}
          f:protocol: {}
          f:targetPort: {}
      f:selector: {}
      f:type: {}
  manager: kubectl
  operation: Apply
  time: "2023-08-31T12:43:32Z"
- apiVersion: v1
  fieldsType: FieldsV1
  fieldsV1:
    f:metadata:
      f:finalizers:
        .: {}
        v:"garden.dns.gardener.cloud/service-dns": {}
  manager: dns-controller-manager
  operation: Update
  time: "2023-08-31T12:43:32Z"
- apiVersion: v1
  fieldsType: FieldsV1
  fieldsV1:
    f:metadata:
      f:finalizers:
        v:"azure.remedy.gardener.cloud/service": {}
  manager: remedy-controller-azure
  operation: Update
  time: "2023-08-31T12:43:40Z"
- apiVersion: v1
  fieldsType: FieldsV1
  fiel
    f:metadata:
      f:annotations:
        f:service.beta.kubernetes.io/azure-load-balancer-ipv4: {}
        f:service.beta.kubernetes.io/azure-load-balancer-resource-group: {}
    f:spec:
      f:loadBalancerIP: {}
  manager: static-ip-distributor
  operation: Update
  time: "2023-08-31T12:45:08Z"
- apiVersion: v1
  fieldsType: FieldsV1
  fieldsV1:
    f:metadata:
      f:finalizers:
        v:"service.kubernetes.io/load-balancer-cleanup": {}
    f:status:
      f:loadBalancer:
        f:ingress: {}
  manager: cloud-controller-manager
  operation: Update
  subresource: status
  time: "2023-08-31T12:45:24Z"
```



### What did you expect to happen?

The "managedFields" field cannot be overwritten, which will trigger the downtime for the cluster.

### How can we reproduce it (as minimally and precisely as possible)?

Using the comment below may occasionally cause this issue to occur.
`kubectl apply app.yaml --server-side --force-conflicts`

### Anything else we need to know?

_No response_

### Kubernetes version

```
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.4", GitCommit:"872a965c6c6526caa949f0c6ac028ef7aff3fb78", GitTreeState:"clean", BuildDate:"2022-11-09T13:28:30Z", GoVersion:"go1.19.3", Compiler:"gc", Platform:"darwin/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.10", GitCommit:"e770bdbb87cccdc2daa790ecd69f40cf4df3cc9d", GitTreeState:"clean", BuildDate:"2023-05-17T14:06:35Z", GoVersion:"go1.19.9", Compiler:"gc", Platform:"linux/amd64"}
```

### Cloud provider

<details>
Gardener: https://gardener.cloud/
</details>


### OS version

<details>

```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
```

</details>


### Install tools

<details>

</details>


### Container runtime (CRI) and version (if applicable)

<details>

</details>


### Related plugins (CNI, CSI, ...) and versions (if applicable)

<details>

</details>