Skip to content

Commit

Permalink
Merge pull request #1229 from citrix/sslvserver
Browse files Browse the repository at this point in the history
Updated the delete func to handle the unset of sslprofile
  • Loading branch information
rohit-myali authored Nov 21, 2024
2 parents b823693 + 760213d commit ca65c69
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions citrixadc/resource_citrixadc_sslvserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,23 @@ func updateSslvserverFunc(d *schema.ResourceData, meta interface{}) error {
func deleteSslvserverFunc(d *schema.ResourceData, meta interface{}) error {
log.Printf("[DEBUG] citrixadc-provider: In deleteSslvserverFunc")
// sslvserver does not have DELETE operation, but this function is required to set the ID to ""

// this unsets the sslprofile for the sslvserver, making it no issues to delete the sslprofile
if _, ok := d.GetOk("sslprofile"); !ok {

client := meta.(*NetScalerNitroClient).client
sslvserverName := d.Get("vservername").(string)

sslvserverunset := make(map[string]interface{})
sslvserverunset["sslprofile"] = true
sslvserverunset["vservername"] = sslvserverName

err := client.ActOnResource("sslvserver", sslvserverunset, "unset")
if err != nil {
return err
}
}

d.SetId("")

return nil
Expand Down

0 comments on commit ca65c69

Please sign in to comment.