Skip to content

Fix networkDiagnostics validation failure with Server-Side Apply#316

Merged
heypnus merged 1 commit into
vmware:mainfrom
xh013325:fix-networkDiagnostics-schema
Jul 21, 2026
Merged

Fix networkDiagnostics validation failure with Server-Side Apply#316
heypnus merged 1 commit into
vmware:mainfrom
xh013325:fix-networkDiagnostics-schema

Conversation

@xh013325

Copy link
Copy Markdown
Contributor

Summary

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

  • Confirmed go build -o /dev/null ./cmd/manager succeeds.

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 32a05f2 into vmware:main Jul 21, 2026
3 checks passed
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.

3 participants