Skip to content

Conversation

@thcdrt
Copy link
Contributor

@thcdrt thcdrt commented Jan 22, 2026

Description

Add several missing container-registry commands.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Improvement (improvement of existing commands)
  • Documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code
  • I updated the documentation by running make doc
  • I ran go mod tidy
  • I have added tests that prove my fix is effective or that my feature works

@thcdrt thcdrt requested a review from a team as a code owner January 22, 2026 14:57
@thcdrt thcdrt force-pushed the dev/thcdrt/container-registry-add-users-cmds branch from 240151c to db4f228 Compare January 22, 2026 14:57
@amstuta amstuta requested a review from Copilot January 22, 2026 15:07
Copy link

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 PR adds container registry user management commands to the OVHcloud CLI, enabling users to list, get, create, set admin privileges, and delete container registry users. The implementation follows the existing pattern of the codebase with proper API endpoints, templates, and comprehensive test coverage.

Changes:

  • Added five new user management commands: list, get, create, set-as-admin, and delete
  • Created user-specific template and parameter sample files
  • Added plan information display to the container registry template
  • Generated complete documentation for all new commands

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/services/cloud/templates/cloud_container_registry_user.tmpl New template for displaying user information
internal/services/cloud/templates/cloud_container_registry.tmpl Added plan name field to registry display
internal/services/cloud/parameter-samples/container-registry-user-create.json Sample JSON for user creation parameters
internal/services/cloud/cloud_container_registry.go Implemented five user management functions and data structures
internal/cmd/cloud_container_registry_test.go Comprehensive test suite covering all user operations
internal/cmd/cloud_container_registry.go Command definitions and flag configurations for user management
doc/ovhcloud_cloud_container-registry_users_set-as-admin.md Generated documentation for set-as-admin command
doc/ovhcloud_cloud_container-registry_users_list.md Generated documentation for list command
doc/ovhcloud_cloud_container-registry_users_get.md Generated documentation for get command
doc/ovhcloud_cloud_container-registry_users_delete.md Generated documentation for delete command
doc/ovhcloud_cloud_container-registry_users_create.md Generated documentation for create command
doc/ovhcloud_cloud_container-registry_users.md Generated documentation for users parent command
doc/ovhcloud_cloud_container-registry.md Updated to reference new users subcommand

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@thcdrt thcdrt marked this pull request as draft January 22, 2026 16:02
@thcdrt thcdrt force-pushed the dev/thcdrt/container-registry-add-users-cmds branch from ee8dc42 to 8d4ebaf Compare January 23, 2026 10:11
Signed-off-by: Thomas Coudert <thomas.coudert@ovhcloud.com>
Signed-off-by: Thomas Coudert <thomas.coudert@ovhcloud.com>
@thcdrt thcdrt force-pushed the dev/thcdrt/container-registry-add-users-cmds branch 7 times, most recently from 89a6242 to 21ec388 Compare January 26, 2026 16:04
@thcdrt thcdrt marked this pull request as ready for review January 26, 2026 16:07
@thcdrt thcdrt force-pushed the dev/thcdrt/container-registry-add-users-cmds branch from 9005a37 to 5f5e019 Compare January 26, 2026 16:56
@thcdrt thcdrt requested a review from Copilot January 29, 2026 13:54
Copy link

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

Copilot reviewed 41 out of 42 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (6)

internal/cmd/cloud_container_registry_test.go:1

  • Multiple test cases use timestamps in 2026. Consider using past dates or dates relative to test execution time for consistency with testing best practices.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

internal/cmd/cloud_container_registry_test.go:1

  • Multiple test cases use timestamps in 2026. Consider using past dates or dates relative to test execution time for consistency with testing best practices.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

internal/cmd/cloud_container_registry_test.go:1

  • Multiple test cases use timestamps in 2026. Consider using past dates or dates relative to test execution time for consistency with testing best practices.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

internal/cmd/cloud_container_registry_test.go:1

  • Multiple test cases use timestamps in 2026. Consider using past dates or dates relative to test execution time for consistency with testing best practices.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

internal/cmd/cloud_container_registry_test.go:1

  • Multiple test cases use timestamps in 2026. Consider using past dates or dates relative to test execution time for consistency with testing best practices.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

internal/cmd/cloud_container_registry_test.go:1

  • Multiple test cases use timestamps in 2026. Consider using past dates or dates relative to test execution time for consistency with testing best practices.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Thomas Coudert <thomas.coudert@ovhcloud.com>
Signed-off-by: Thomas Coudert <thomas.coudert@ovhcloud.com>
@thcdrt thcdrt force-pushed the dev/thcdrt/container-registry-add-users-cmds branch from 0b652b6 to 61b543b Compare January 29, 2026 14:00
@thcdrt thcdrt changed the title feat: Add container-registry users feat: Add missing container-registry commands Jan 29, 2026
@thcdrt thcdrt requested a review from Copilot January 29, 2026 14:03
Copy link

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

Copilot reviewed 41 out of 42 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (5)

internal/cmd/cloud_reference_test.go:1

  • Test data contains multiple timestamps in 2026, which is in the future. Consider using dates that are in the past or relative to the current date to make the test data more realistic and avoid potential confusion.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

internal/cmd/cloud_reference_test.go:1

  • Test data contains multiple timestamps in 2026, which is in the future. Consider using dates that are in the past or relative to the current date to make the test data more realistic and avoid potential confusion.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

internal/cmd/cloud_reference_test.go:1

  • Test data contains multiple timestamps in 2026, which is in the future. Consider using dates that are in the past or relative to the current date to make the test data more realistic and avoid potential confusion.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

internal/cmd/cloud_reference_test.go:1

  • Test data contains multiple timestamps in 2026, which is in the future. Consider using dates that are in the past or relative to the current date to make the test data more realistic and avoid potential confusion.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

internal/cmd/cloud_reference_test.go:1

  • Test data contains multiple timestamps in 2026, which is in the future. Consider using dates that are in the past or relative to the current date to make the test data more realistic and avoid potential confusion.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Thomas Coudert <thomas.coudert@ovhcloud.com>
@thcdrt thcdrt force-pushed the dev/thcdrt/container-registry-add-users-cmds branch from 61b543b to f7d69bb Compare January 29, 2026 14:08
@thcdrt thcdrt requested a review from Copilot January 29, 2026 14:09
Copy link

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

Copilot reviewed 41 out of 42 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (7)

internal/cmd/cloud_container_registry_test.go:1

  • Test data consistently uses dates in 2026. While this may be acceptable for test fixtures, consider using past dates or clearly marked future dates to avoid confusion about test data validity.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

internal/cmd/cloud_container_registry_test.go:1

  • Test data consistently uses dates in 2026. While this may be acceptable for test fixtures, consider using past dates or clearly marked future dates to avoid confusion about test data validity.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

internal/cmd/cloud_container_registry_test.go:1

  • Test data consistently uses dates in 2026. While this may be acceptable for test fixtures, consider using past dates or clearly marked future dates to avoid confusion about test data validity.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

internal/cmd/cloud_container_registry_test.go:1

  • Test data consistently uses dates in 2026. While this may be acceptable for test fixtures, consider using past dates or clearly marked future dates to avoid confusion about test data validity.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

internal/cmd/cloud_container_registry_test.go:1

  • Test data consistently uses dates in 2026. While this may be acceptable for test fixtures, consider using past dates or clearly marked future dates to avoid confusion about test data validity.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

internal/cmd/cloud_container_registry_test.go:1

  • Test data consistently uses dates in 2026. While this may be acceptable for test fixtures, consider using past dates or clearly marked future dates to avoid confusion about test data validity.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

internal/cmd/cloud_container_registry_test.go:1

  • Test data consistently uses dates in 2026. While this may be acceptable for test fixtures, consider using past dates or clearly marked future dates to avoid confusion about test data validity.
// SPDX-FileCopyrightText: 2025 OVH SAS <opensource@ovh.net>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@amstuta amstuta left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution @thcdrt ! Just added a few comments, but after that we'll be good to merge.

Run: cloud.ListContainerRegistryIPRestrictionsManagement,
Args: cobra.ExactArgs(1),
}
managementCmd.AddCommand(managementListCmd)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
managementCmd.AddCommand(managementListCmd)
managementCmd.AddCommand(withFilterFlag(managementListCmd))

Run: cloud.ListContainerRegistryIPRestrictionsRegistry,
Args: cobra.ExactArgs(1),
}
registryRestrictionsCmd.AddCommand(registryListCmd)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
registryRestrictionsCmd.AddCommand(registryListCmd)
registryRestrictionsCmd.AddCommand(withFilterFlag(registryListCmd))

CloudContainerRegistryOidcCreateSample,
CloudContainerRegistryOidcCreateSpec,
assets.CloudOpenapiSchema,
[]string{ // Make it empty as it looks like CreateResource function does not support embedded map
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe just keep "provider" in there and add a TODO: ... comment to handle embedded maps at some point

"updatedAt": restriction.UpdatedAt,
})
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

add filtering before rendering table

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