Skip to content

allow set multiple values for same category keys#150

Merged
tuxtof merged 1 commit intomasterfrom
fix/category-values
Jul 28, 2025
Merged

allow set multiple values for same category keys#150
tuxtof merged 1 commit intomasterfrom
fix/category-values

Conversation

@tuxtof
Copy link
Copy Markdown
Collaborator

@tuxtof tuxtof commented Jul 28, 2025

This pull request updates dependencies and refactors the NutanixDriver implementation to improve compatibility with the latest version of the Nutanix client library. Key changes include dependency updates in go.mod, adjustments to reflect API changes in the Nutanix client, and the introduction of context handling for API calls.

Dependency Updates:

  • Updated github.com/nutanix-cloud-native/prism-go-client from v0.2.0 to v0.5.2 in go.mod to use the latest Nutanix client library.
  • Added new indirect dependencies (e.g., github.com/go-logr/logr, github.com/go-openapi/*, and others) and removed unused ones (e.g., github.com/hashicorp/*) in go.mod.

Refactoring for API Changes:

  • Updated import paths for the Nutanix client library in machine/driver/driver.go and utils/extra.go to align with the new structure (v3 package moved). [1] [2]
  • Replaced metadata.Categories with metadata.CategoriesMapping and enabled metadata.UseCategoriesMapping to support the updated API for handling categories. [1] [2]

Context Handling:

  • Introduced context.Context to all Nutanix API calls for better control over request lifecycles (e.g., ListAllProject, CreateVM, GetTask, etc.). [1] [2] [3] [4] and others)

Code Cleanup:

  • Simplified API calls by aligning with the updated Nutanix client library's method signatures (e.g., ListAllCluster, ListAllSubnet). [1] [2]

These changes ensure compatibility with the latest Nutanix client library and improve code maintainability by leveraging modern practices like context handling.

@tuxtof tuxtof added bug Something isn't working dependencies Pull requests that update a dependency file labels Jul 28, 2025
@tuxtof tuxtof requested a review from Copilot July 28, 2025 09:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request upgrades the Nutanix client library from v0.2.0 to v0.5.2 and refactors the NutanixDriver implementation to maintain compatibility with the newer API. The changes introduce context handling for better request lifecycle management and update the category handling mechanism to support multiple values per category key.

  • Updated Nutanix client library dependency and adjusted import paths
  • Added context.Context parameter to all Nutanix API calls
  • Refactored category handling to use CategoriesMapping instead of Categories

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
go.mod Updates Nutanix client dependency from v0.2.0 to v0.5.2 and adds new indirect dependencies
utils/extra.go Updates import path for Nutanix v3 client package
machine/driver/driver.go Adds context handling, updates import paths, and refactors category handling to support multiple values

Comment thread machine/driver/driver.go Outdated
@tuxtof tuxtof force-pushed the fix/category-values branch 2 times, most recently from 4b4562c to 1fef97a Compare July 28, 2025 09:48
@tuxtof tuxtof force-pushed the fix/category-values branch from 1fef97a to 5fcdf4e Compare July 28, 2025 13:27
@tuxtof tuxtof merged commit 4c82e28 into master Jul 28, 2025
8 checks passed
@tuxtof tuxtof deleted the fix/category-values branch August 5, 2025 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants