Skip to content

Unsetting attributes like WafPolicyRef is not possible #244

Open
@vidarno

Description

@vidarno

Describe the bug

Using version 22.1.6 (and older versions) of the plugin it seems to be impossible to unset an attribute like WafPolicyRef or VSDataScripts?
On the AviVirtualService-object I have tried both
vs.setWafPolicyRef(null);
vs.wafPolicyRef = null;
as well as other desperate attempts like setting the attribute to "0", "" (an empty sting), false or even removing the attribute altogether from the object.

But after calling addObject on the AviVroClient-object and passing the vs-object there doesn't seem to be made an attempt to update the object on AVI - there is no entry in the audit log on AVI and the resource is not changed, unlike whenever we make other changes like switching between different WAF-policies.

Reproduction steps

  1. Get an exisiting virtualservice:
    virtualservice = aviVroClient.getObjectByUUID('virtualservice',vsUuid);

  2. Unset the WafPolicyRef attribute which is currently not null:
    virtualservice.setWafPolicyRef(null);

  3. Attempt to update the virtualservice-resource on AVI:
    aviVroClient.addObject(virtualservice,workflowRuntime.getWorkflowId(),tenant)

This action completes with no error, but does not seem to trigger a PUT to the specified resource, as no change is seen on the resource in AVI, nor is there any entry in the audit log for this update.

Expected behavior

Setting an attribute to null should cause addObject to send a PUT setting the atribute to null.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions