-
Notifications
You must be signed in to change notification settings - Fork 15
feat: Add missing container-registry commands #124
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
base: main
Are you sure you want to change the base?
feat: Add missing container-registry commands #124
Conversation
240151c to
db4f228
Compare
There was a problem hiding this 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.
ee8dc42 to
8d4ebaf
Compare
Signed-off-by: Thomas Coudert <thomas.coudert@ovhcloud.com>
Signed-off-by: Thomas Coudert <thomas.coudert@ovhcloud.com>
89a6242 to
21ec388
Compare
9005a37 to
5f5e019
Compare
There was a problem hiding this 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>
0b652b6 to
61b543b
Compare
There was a problem hiding this 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>
61b543b to
f7d69bb
Compare
There was a problem hiding this 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.
amstuta
left a comment
There was a problem hiding this 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| managementCmd.AddCommand(managementListCmd) | |
| managementCmd.AddCommand(withFilterFlag(managementListCmd)) |
| Run: cloud.ListContainerRegistryIPRestrictionsRegistry, | ||
| Args: cobra.ExactArgs(1), | ||
| } | ||
| registryRestrictionsCmd.AddCommand(registryListCmd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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 |
There was a problem hiding this comment.
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, | ||
| }) | ||
| } | ||
|
|
There was a problem hiding this comment.
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
Description
Add several missing container-registry commands.
Type of change
Please delete options that are not relevant.
Checklist:
make docgo mod tidy