vsphere/resource_vsphere_license.go
func resourceVSphereLicenseUpdate(d *schema.ResourceData, meta interface{}) error {
	log.Println("[INFO] Running the update method")

	client := meta.(*VSphereClient).vimClient
	manager := license.NewManager(client.Client)

	if key, ok := d.GetOk("license_key"); ok {
		licenseKey := key.(string)
		if !isKeyPresent(licenseKey, manager) {
			return ErrNoSuchKeyFound
		}

		if d.HasChange("labels") {
			labelMap := d.Get("labels").(map[string]interface{})

			err := updateLabels(manager, licenseKey, labelMap)
			if err != nil {
				return err
			}
		}
	}

	return resourceVSphereLicenseRead(d, meta)
}
func resourceVSphereLicenseUpdate(d *schema.ResourceData, meta interface{}) error {
	log.Println("[INFO] Running the update method")

	client := meta.(*VSphereClient).vimClient
	manager := license.NewManager(client.Client)

	if key, ok := d.GetOk("license_key"); ok {
		licenseKey := key.(string)
		if !isKeyPresent(licenseKey, manager) {
			return ErrNoSuchKeyFound
		}

		if d.HasChange("labels") {
			labelMap := d.Get("labels").(map[string]interface{})

			err := updateLabels(manager, licenseKey, labelMap)
			if err != nil {
				return err
			}
		}
	}

	return resourceVSphereLicenseRead(d, meta)
}
// resourceVSphereLicenseUpdate check for change in labels of the key and updates them.