Skip to content

[Backport release_9.1.1] Fix networkDiagnostics validation failure with Server-Side Apply#317

Merged
heypnus merged 1 commit into
vmware:release_9.1.1from
xh013325:fix-networkDiagnostics-schema-9.1.1
Jul 21, 2026
Merged

[Backport release_9.1.1] Fix networkDiagnostics validation failure with Server-Side Apply#317
heypnus merged 1 commit into
vmware:release_9.1.1from
xh013325:fix-networkDiagnostics-schema-9.1.1

Conversation

@xh013325

Copy link
Copy Markdown
Contributor

Summary

This is a backport of #316 to the release_9.1.1 branch.

This fixes an issue where the nsx-ncp-operator degrades on OpenShift due to an OpenAPI schema validation mismatch with newer OpenShift versions (OCP 4.16+).

Even though the managedFields issue was resolved, when the operator's configmap-controller (updateNetworkStatus) attempts to patch the Network.config.openshift.io resource, it serializes empty nested fields of the networkDiagnostics struct as JSON null values. The OpenShift API server's CRD validation strictly prohibits null for these fields (expecting objects or arrays).

To fix this, we remove the spec field from the apply configuration so that the operator only applies status/metadata changes, avoiding schema validation failures on uninitialized spec.networkDiagnostics fields.

Test plan

  • Backport cleanly applied via cherry-pick.

Made with Cursor

Remove 'spec' field from the apply configuration so that the operator only applies status/metadata changes. This avoids schema validation failures on uninitialized 'spec.networkDiagnostics' fields introduced in newer OpenShift versions (4.16+).

Co-authored-by: Cursor <cursoragent@cursor.com>
@heypnus

heypnus commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

I had a quick chat with Xiao about this patch. Due to environment and time constraints, it hasn't been run through e2e tests yet. However, given its limited potential side effects, we decided to merge it first to speed up follow-up validation.

@heypnus
heypnus merged commit c277ffa into vmware:release_9.1.1 Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants