oVirt / oVirt/ovirt-engine-sdk-java

Cannot replace or remove cluster custom scheduling policy properties

Open
#41 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
30
Forks
26
PR merge metrics
No merged PRs in 30d

Description

Environment:
oVirt Engine Version: ovirt-engine-4.5.3.8-2.el8ev
oVirt Java SDK Version: org.ovirt.engine.api:sdk:4.5.1
Java Version: 21

When using the oVirt Java SDK to update a cluster's customSchedulingPolicyProperties, I encounter the following problem:

Example Code:

Cluster cluster = cluster()
    .customSchedulingPolicyProperties(properties)
    .build();

connection.systemService()
    .dataCentersService()
    .dataCenterService(dataCenterId)
    .clustersService()
    .clusterService(clusterId)
    .update()
    .cluster(cluster)
    .send();

Expected Result:
When passing a new properties list, the existing customSchedulingPolicyProperties in the cluster should be completely replaced by the new list.
If an empty list is passed as the properties, the existing customSchedulingPolicyProperties should be removed entirely, leaving only the schedulingPolicy applied.

Actual Result:
When passing a new list of properties, the existing customSchedulingPolicyProperties are not replaced. Instead, the new properties are added or updated, leaving the old properties intact.
When passing an empty list, the existing customSchedulingPolicyProperties are not removed, and they remain unchanged.

Questions:
Is this behavior intentional? If yes, how can I remove existing customSchedulingPolicyProperties completely using the oVirt Java SDK?
If this is not intentional, is it possible to address this issue or provide a workaround to achieve the expected behavior?
Please confirm whether this is a bug or an intended design choice. If additional information is needed, I am happy to provide more details or clarification.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the clusterService(...).update().cluster(...).send() entry point and trace how customSchedulingPolicyProperties is handled for non-empty and empty lists. Reproduce both cases from the example, then verify that replacement removes old properties and an empty list removes them entirely; no file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.