Skip to content

[BUG] Removing Last VMClass/Contentlibrary from Namespaces VMServiceSpec using vapi #4010

@tribock

Description

@tribock

We want to provision namespaces using an operator.
We're using govmomi for that and implemented the VMClassAssigment object in crossplane that assigns a VMClass to a vsphere namespace.

This works quite well so far, except when it comes to deleting the VMClass and only one VMClass is assigned.

With an empty VMClass Object in the UpdateSpec's VMServiceSpec the vcenter API returns success but the VMClass remains assigned.

Similar behaviour as described in #4007

link to api-doc:

https://developer.broadcom.com/xapis/vsphere-automation-api/v7.0U3/vcenter/api/vcenter/namespaces/instances/namespace/patch/

Is this behaviour intended? how is it able to remove the last storage policy from the namespace?

I Suggest to remove the omitempty as well.

To Reproduce
Steps to reproduce the behavior:

  1. Create Namespace with VMClass
  2. Update Namespace with Empty VMClass Object (using govmomi)

Expected behavior

Empty stroage Spec is Respected and the Plicies are removed from the object.

Affected version
latest@main

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions