René's URL Explorer Experiment


Title: jsonMergePatch operations use Fabric8 JSON Patch semantics and can remove spec · Issue #3512 · operator-framework/java-operator-sdk · GitHub

Open Graph Title: jsonMergePatch operations use Fabric8 JSON Patch semantics and can remove spec · Issue #3512 · operator-framework/java-operator-sdk

X Title: jsonMergePatch operations use Fabric8 JSON Patch semantics and can remove spec · Issue #3512 · operator-framework/java-operator-sdk

Description: What happened? ResourceOperations.jsonMergePatch(...) and ResourceOperations.jsonMergePatchPrimary(...) are documented as applying RFC 7386 JSON Merge Patch, but they delegate to Fabric8's no-context .patch() method. Fabric8's default .p...

Open Graph Description: What happened? ResourceOperations.jsonMergePatch(...) and ResourceOperations.jsonMergePatchPrimary(...) are documented as applying RFC 7386 JSON Merge Patch, but they delegate to Fabric8's no-conte...

X Description: What happened? ResourceOperations.jsonMergePatch(...) and ResourceOperations.jsonMergePatchPrimary(...) are documented as applying RFC 7386 JSON Merge Patch, but they delegate to Fabric8's no-c...

Opengraph URL: https://github.com/operator-framework/java-operator-sdk/issues/3512

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"jsonMergePatch operations use Fabric8 JSON Patch semantics and can remove spec","articleBody":"### What happened?\n\n`ResourceOperations.jsonMergePatch(...)` and `ResourceOperations.jsonMergePatchPrimary(...)` are documented as applying RFC 7386 JSON Merge Patch, but they delegate to Fabric8's no-context `.patch()` method.\n\nFabric8's default `.patch()` intentionally fetches the current resource and computes an RFC 6902 JSON Patch diff. When the supplied resource is a partial metadata patch, the generated diff removes fields that are omitted from the partial object, including `spec`.\n\nThe status variants are not affected because Fabric8's `patchStatus()` explicitly selects `PatchType.JSON_MERGE`.\n\n### Versions verified\n\n- Java Operator SDK 5.3.5 with Fabric8 7.7.0\n- Java Operator SDK 5.5.0 with Fabric8 7.8.0\n\nThe behavior is still present in the current `main` branch.\n\n### Minimal reproduction\n\nAssume this custom resource already exists:\n\n```yaml\napiVersion: example.io/v1\nkind: Example\nmetadata:\n  name: example\nspec:\n  value: keep-me\n```\n\nApply a partial metadata patch through `ResourceOperations`:\n\n```java\nExample patch = new Example();\npatch.getMetadata().setName(\"example\");\npatch.getMetadata().setLabels(Map.of(\"resolved\", \"true\"));\n\ncontext.resourceOperations().jsonMergePatchPrimary(patch);\n```\n\nFabric8 computes a JSON Patch equivalent to:\n\n```json\n[\n  {\"op\":\"add\",\"path\":\"/metadata/labels/resolved\",\"value\":\"true\"},\n  {\"op\":\"remove\",\"path\":\"/spec\"},\n  {\"op\":\"remove\",\"path\":\"/status\"}\n]\n```\n\nFor a CRD whose root `spec` is optional, the API server accepts the patch and permanently removes the spec. We encountered this in a real controller where subsequent reconciliation failed because `getSpec()` returned null.\n\n### Expected behavior\n\nMethods named and documented as JSON Merge Patch should send `application/merge-patch+json` and preserve fields omitted from the partial resource.\n\n### Relevant implementation\n\nJOSDK 5.5.0 delegates to `.patch()` without specifying a patch type:\n\n- [`ResourceOperations.jsonMergePatchPrimary`](https://github.com/operator-framework/java-operator-sdk/blob/v5.5.0/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ResourceOperations.java#L838-L843)\n\nFabric8's default `.patch()` selects JSON Patch and diffs the current and supplied resources:\n\n- [`HasMetadataOperation.patch()`](https://github.com/fabric8io/kubernetes-client/blob/v7.8.0/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/HasMetadataOperation.java#L245-L246)\n- [`OperationSupport.handlePatch(...)`](https://github.com/fabric8io/kubernetes-client/blob/v7.8.0/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/OperationSupport.java#L377-L397)\n\n### Suggested fix\n\nMake the non-status JSON Merge Patch operations pass an explicit patch context, for example:\n\n```java\nr -> context.getClient()\n    .resource(r)\n    .patch(PatchContext.of(PatchType.JSON_MERGE), r)\n```\n\nThe cache and own-event filtering behavior can remain unchanged. Regression coverage should create a complete resource, apply a partial metadata merge patch, and assert that `spec` survives.\n","author":{"url":"https://github.com/brianzilliz","@type":"Person","name":"brianzilliz"},"datePublished":"2026-07-23T08:01:42Z","url":"https://github.com/operator-framework/java-operator-sdk/issues/3512"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c3e48303-c6de-01c1-504f-6bbee62a487d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8BAE:137C1B:F589AF:1421E6E:6AED5DD9
html-safe-noncecf5f354a9a22bbf16a52bb34fe7aedcf67dd43d42b15660369f3701d416ed653
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QkFFOjEzN0MxQjpGNTg5QUY6MTQyMUU2RTo2QUVENUREOSIsInZpc2l0b3JfaWQiOiIyMjM1NzUyNTg1MDA1NzE5MDAxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacb67c655d322688fe6c647aeba2a0f39a531104fcddf9dd204f16e3fd9404e411
hovercard-subject-tagissue:4956755580
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/operator-framework/java-operator-sdk/3512/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e83ea2bfeee12244da65671987405f29625abb2810f05edb894f2f75c371504e/operator-framework/java-operator-sdk/issues/3512
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e83ea2bfeee12244da65671987405f29625abb2810f05edb894f2f75c371504e/operator-framework/java-operator-sdk/issues/3512
og:image:altWhat happened? ResourceOperations.jsonMergePatch(...) and ResourceOperations.jsonMergePatchPrimary(...) are documented as applying RFC 7386 JSON Merge Patch, but they delegate to Fabric8's no-conte...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebrianzilliz
hostnamegithub.com
expected-hostnamegithub.com
None56fb42677ae87ed3e64410323d67980aa65d0485568a7858f874e7edfc6d1c11
turbo-cache-controlno-preview
go-importgithub.com/operator-framework/java-operator-sdk git https://github.com/operator-framework/java-operator-sdk.git
octolytics-dimension-user_id38202270
octolytics-dimension-user_loginoperator-framework
octolytics-dimension-repository_id188592933
octolytics-dimension-repository_nwooperator-framework/java-operator-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id188592933
octolytics-dimension-repository_network_root_nwooperator-framework/java-operator-sdk
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9c9a37e2423ed382cf39f70b5aa4b4858b40a3b0
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/operator-framework/java-operator-sdk/issues/3512#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Foperator-framework%2Fjava-operator-sdk%2Fissues%2F3512
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Foperator-framework%2Fjava-operator-sdk%2Fissues%2F3512
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=operator-framework%2Fjava-operator-sdk
Reloadhttps://github.com/operator-framework/java-operator-sdk/issues/3512
Reloadhttps://github.com/operator-framework/java-operator-sdk/issues/3512
Reloadhttps://github.com/operator-framework/java-operator-sdk/issues/3512
operator-frameworkhttps://github.com/operator-framework
java-operator-sdkhttps://github.com/operator-framework/java-operator-sdk
Codehttps://github.com/operator-framework/java-operator-sdk
Issues49 (49)https://github.com/operator-framework/java-operator-sdk/issues
Pull requests11 (11)https://github.com/operator-framework/java-operator-sdk/pulls
Discussionshttps://github.com/operator-framework/java-operator-sdk/discussions
Actionshttps://github.com/operator-framework/java-operator-sdk/actions
Projectshttps://github.com/operator-framework/java-operator-sdk/projects
Security and qualityhttps://github.com/operator-framework/java-operator-sdk/security
Insightshttps://github.com/operator-framework/java-operator-sdk/pulse
https://github.com/operator-framework/java-operator-sdk
New issuehttps://github.com/login?return_to=https://github.com/operator-framework/java-operator-sdk/issues/3512
New issuehttps://github.com/login?return_to=https://github.com/operator-framework/java-operator-sdk/issues/3512
#3514https://github.com/operator-framework/java-operator-sdk/pull/3514
jsonMergePatch operations use Fabric8 JSON Patch semantics and can remove spechttps://github.com/operator-framework/java-operator-sdk/issues/3512#top
#3514https://github.com/operator-framework/java-operator-sdk/pull/3514
5.6https://github.com/operator-framework/java-operator-sdk/milestone/20
https://github.com/brianzilliz
brianzillizhttps://github.com/brianzilliz
on Jul 23, 2026https://github.com/operator-framework/java-operator-sdk/issues/3512#issue-4956755580
ResourceOperations.jsonMergePatchPrimaryhttps://github.com/operator-framework/java-operator-sdk/blob/v5.5.0/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ResourceOperations.java#L838-L843
HasMetadataOperation.patch()https://github.com/fabric8io/kubernetes-client/blob/v7.8.0/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/HasMetadataOperation.java#L245-L246
OperationSupport.handlePatch(...)https://github.com/fabric8io/kubernetes-client/blob/v7.8.0/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/OperationSupport.java#L377-L397
brianzillizhttps://github.com/brianzilliz
completedhttps://github.com/operator-framework/java-operator-sdk/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 23, 2026https://github.com/operator-framework/java-operator-sdk/issues/3512#event-28369997495
brianzillizhttps://github.com/brianzilliz
on Jul 23, 2026https://github.com/operator-framework/java-operator-sdk/issues/3512#event-28370170528
https://github.com/csviri
csvirihttps://github.com/csviri
on Jul 23, 2026https://github.com/operator-framework/java-operator-sdk/issues/3512#issuecomment-5056056654
@brianzillizhttps://github.com/brianzilliz
csvirihttps://github.com/csviri
5.6https://github.com/operator-framework/java-operator-sdk/milestone/20
on Jul 27, 2026https://github.com/operator-framework/java-operator-sdk/issues/3512#event-28536955465
csvirihttps://github.com/csviri
fix: use explicit JSON merge patch type in merge patch operations #3514https://github.com/operator-framework/java-operator-sdk/pull/3514
on Jul 27, 2026https://github.com/operator-framework/java-operator-sdk/issues/3512#event-28549925513
csvirihttps://github.com/csviri
completedhttps://github.com/operator-framework/java-operator-sdk/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#3514https://github.com/operator-framework/java-operator-sdk/pull/3514
on Jul 28, 2026https://github.com/operator-framework/java-operator-sdk/issues/3512#event-28601759886
Sign up for freehttps://github.com/signup?return_to=https://github.com/operator-framework/java-operator-sdk/issues/3512
Sign in to commenthttps://github.com/login?return_to=https://github.com/operator-framework/java-operator-sdk/issues/3512
5.6https://github.com/operator-framework/java-operator-sdk/milestone/20
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.