Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update task handling of hypervisor cluster create #55

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

stuart-mclaren-hpe
Copy link
Contributor

@stuart-mclaren-hpe stuart-mclaren-hpe commented Nov 14, 2024

Update the polling of a hypervisor cluster create task. In the case of hypervisor
create, the sourceResourceUri field in the final task response points to a system
and not the hypervisor cluster that has just been created. (This differs from the task
behaviour for datastores.)

Switch to instead extract the hypervisor cluster uuid from the returned task body's
associatedResources list. (Note that the associatedResources list for datastores is
empty, so we cannot consistently use this approach.)

  "associatedResources": [
    {
      "name": "cluster1",
      "resourceUri": "/virtualization/v1beta1/hypervisor-clusters/298a299e-78f5-5acb-86ce-4e9fdc290ab7",
      "type": "hypervisor-cluster"
    }
  ]

This change avoids terraform erroring after a successful hypervisor create.

@stuart-mclaren-hpe stuart-mclaren-hpe force-pushed the hypervisor-cluster-task branch 2 times, most recently from 676060b to eb2b51f Compare November 14, 2024 15:03
eamonnotoole
eamonnotoole previously approved these changes Nov 14, 2024
Update the polling of a hypervisor cluster create task.  In the case of
hypervisor create, the `sourceResourceUri` field in the final task response
points to a `system` and not the hypervisor cluster that has just been created.
(This differs from the task behaviour for datastores.)

Switch to instead extract the hypervisor cluster uuid from the returned task
body's `associatedResources` list. (Note that the `associatedResources` list
for datastores is empty, so we cannot consistently use this approach.)

```
  "associatedResources": [
    {
      "name": "cluster1",
      "resourceUri": "/virtualization/v1beta1/hypervisor-clusters/298a299e-78f5-5acb-86ce-4e9fdc290ab7",
      "type": "hypervisor-cluster"
    }
  ]

```

This change avoids terraform erroring after a successful hypervisor create.
@stuart-mclaren-hpe stuart-mclaren-hpe merged commit f203f27 into main Nov 14, 2024
5 checks passed
@stuart-mclaren-hpe stuart-mclaren-hpe deleted the hypervisor-cluster-task branch November 14, 2024 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants