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

[UDT PR 4 of N] Add basic commands for UDT support #8035

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

rynowak
Copy link
Contributor

@rynowak rynowak commented Nov 6, 2024

Description

This change adds the most basic commands for interacting with resource providers and resource types. Also added some flexibility to existing commands for resources so they can work with UDTs.

  • rad resourceprovider

    • list
    • show
    • delete
  • rad resourcetype

    • list
    • show

Also added rad resource create. We never implemented anything like this, it was just missing.

Also enhanced the rad resource family of commands to support any fully-qualified resource type. These commands now how to validate and work with the set of built-in types in Radius today using short names like containers.

This set of commands are the easy decisions, and already work well using the existing functionality in the implementation. We'll add some of the more complex commands after a design discussion.

Type of change

  • This pull request adds or changes features of Radius and has an approved issue (issue link required).

Part of: #6688

Contributor checklist

Please verify that the PR meets the following requirements, where applicable:

  • An overview of proposed schema changes is included in a linked GitHub issue.
  • A design document PR is created in the design-notes repository, if new APIs are being introduced.
  • If applicable, design document has been reviewed and approved by Radius maintainers/approvers.
  • A PR for the samples repository is created, if existing samples are affected by the changes in this PR.
  • A PR for the documentation repository is created, if the changes in this PR affect the documentation or any user facing updates are made.
  • A PR for the recipes repository is created, if existing recipes are affected by the changes in this PR.

@rynowak rynowak requested review from a team as code owners November 6, 2024 00:07
@rynowak
Copy link
Contributor Author

rynowak commented Nov 6, 2024

/cc @Reshrahim for feedback on command and help text.

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 71.26100% with 196 lines in your changes missing coverage. Please review.

Project coverage is 59.15%. Comparing base (9e41b41) to head (3840320).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cli/clients/management.go 46.09% 46 Missing and 23 partials ⚠️
pkg/cli/cmd/resourceprovider/delete/delete.go 71.25% 15 Missing and 8 partials ⚠️
pkg/cli/cmd/resourcetype/delete/delete.go 72.61% 15 Missing and 8 partials ⚠️
pkg/cli/cmd/resource/create/create.go 77.50% 12 Missing and 6 partials ⚠️
pkg/cli/cmd/resourceprovider/list/list.go 73.68% 10 Missing and 5 partials ⚠️
pkg/cli/cmd/resourceprovider/show/show.go 74.13% 10 Missing and 5 partials ⚠️
pkg/cli/cmd/resourcetype/list/list.go 75.40% 10 Missing and 5 partials ⚠️
pkg/cli/cmd/resourcetype/show/show.go 78.87% 10 Missing and 5 partials ⚠️
pkg/cli/cmd/resource/delete/delete.go 66.66% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8035      +/-   ##
==========================================
+ Coverage   58.94%   59.15%   +0.20%     
==========================================
  Files         567      576       +9     
  Lines       37726    38407     +681     
==========================================
+ Hits        22236    22718     +482     
- Misses      13945    14077     +132     
- Partials     1545     1612      +67     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@radius-functional-tests
Copy link

radius-functional-tests bot commented Nov 6, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository rynowak/radius
Commit ref 7bb1ca2
Unique ID func5f3d438894
Image tag pr-func5f3d438894
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func5f3d438894
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func5f3d438894
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func5f3d438894
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func5f3d438894
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func5f3d438894
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
❌ Failed to install Radius for corerp-cloud functional test. Please check the logs for more details
❌ corerp-cloud functional test failed. Please check the logs for more details
❌ ucp-cloud functional test cancelled. Please check the logs for more details

@radius-functional-tests
Copy link

radius-functional-tests bot commented Nov 6, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository rynowak/radius
Commit ref 0daafcb
Unique ID func1208ddf4a3
Image tag pr-func1208ddf4a3
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func1208ddf4a3
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func1208ddf4a3
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func1208ddf4a3
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func1208ddf4a3
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func1208ddf4a3
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@rynowak
Copy link
Contributor Author

rynowak commented Nov 6, 2024

This PR will need a rebase. I'll wait until after getting feedback.

Copy link
Contributor

@Reshrahim Reshrahim left a comment

Choose a reason for hiding this comment

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

Suggested some changes.

pkg/cli/cmd/resource/create/create.go Outdated Show resolved Hide resolved
pkg/cli/cmd/resource/create/create.go Outdated Show resolved Hide resolved
pkg/cli/cmd/resourceprovider/delete/delete.go Outdated Show resolved Hide resolved
pkg/cli/cmd/resourceprovider/delete/delete.go Outdated Show resolved Hide resolved
pkg/cli/cmd/resourceprovider/delete/delete.go Outdated Show resolved Hide resolved
pkg/cli/cmd/resourceprovider/list/list.go Outdated Show resolved Hide resolved
pkg/cli/cmd/resourceprovider/show/show.go Outdated Show resolved Hide resolved
Short: "List resource resource types",
Long: `List resource resource types

Resource types are the entities that can be created and managed by Radius such as 'Applications.Core/containers'. Resource types can be configured using resource providers.`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Resource types are the entities that can be created and managed by Radius such as 'Applications.Core/containers'. Resource types can be configured using resource providers.`,
Resource types are schema definitions for resources that can be created and managed by Radius such as 'Applications.Core/containers'. Resource types can be configured using resource providers.`,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They aren't really just the schema defintions. Schema is definitely an important part. Let me try rephrasing...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For example it's not actually the resource types that define a schema. Resource types define api versions, and api versions define schemas.

pkg/cli/cmd/resourcetype/show/show.go Outdated Show resolved Hide resolved
pkg/cli/clients/clients.go Outdated Show resolved Hide resolved
pkg/cli/clients/management.go Outdated Show resolved Hide resolved
pkg/cli/clients/management.go Outdated Show resolved Hide resolved
pkg/cli/clients/management_mocks.go Show resolved Hide resolved
pkg/cli/clivalidation.go Outdated Show resolved Hide resolved
pkg/cli/cmd/resourceprovider/delete/delete.go Outdated Show resolved Hide resolved
pkg/cli/cmd/resourcetype/list/list.go Outdated Show resolved Hide resolved
pkg/cli/cmd/resourcetype/list/list.go Outdated Show resolved Hide resolved
pkg/cli/cmd/resourcetype/show/show.go Outdated Show resolved Hide resolved
cmd/rad/cmd/root.go Outdated Show resolved Hide resolved
This change adds the most basic commands for interacting with resource providers and resource types. Also added some flexibility to
existing commands for resources so they can work with UDTs.

- `rad resourceprovider`
  - `list`
  - `show`
  - `delete`

- `rad resourcetype`
  - `list`
  - `show`

Also added `rad resource create`. We never implemented anything like this, it was just missing.

Also enhanced the `rad resource` family of commands to support any fully-qualified resource type. These commands now how to validate and work with the set of built-in types in Radius today using short names like `containers`.

This set of commands are the easy decisions, and already work well using the existing functionality in the implementation. We'll add some of the more complex commands after a design dicussion.

Signed-off-by: Ryan Nowak <nowakra@gmail.com>
@rynowak
Copy link
Contributor Author

rynowak commented Nov 11, 2024

@Reshrahim @ytimocin @nithyatsu - updated

@radius-functional-tests
Copy link

radius-functional-tests bot commented Nov 11, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository rynowak/radius
Commit ref b0a69ea
Unique ID func394ed6196b
Image tag pr-func394ed6196b
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func394ed6196b
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func394ed6196b
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func394ed6196b
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func394ed6196b
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func394ed6196b
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@rynowak rynowak changed the title Add basic commands for UDT support [UDT PR 4 of N] Add basic commands for UDT support Nov 11, 2024
Copy link
Contributor

@superbeeny superbeeny left a comment

Choose a reason for hiding this comment

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

Nice, clean, easy to follow code. Nothing really to add aside from a semantic nit or two, LGTM

Signed-off-by: Ryan Nowak <nowakra@gmail.com>
@radius-functional-tests
Copy link

radius-functional-tests bot commented Nov 11, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository rynowak/radius
Commit ref ef814d7
Unique ID func8e480a4e33
Image tag pr-func8e480a4e33
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func8e480a4e33
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func8e480a4e33
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func8e480a4e33
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func8e480a4e33
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func8e480a4e33
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

Signed-off-by: Ryan Nowak <nowakra@gmail.com>
cmd/rad/cmd/resourceprovider.go Outdated Show resolved Hide resolved
NewListProviderSummariesPager(planeName string, options *ucpv20231001.ResourceProvidersClientListProviderSummariesOptions) *runtime.Pager[ucpv20231001.ResourceProvidersClientListProviderSummariesResponse]
}

// resourceProviderClient is an interface for mocking the generated SDK client for resource types.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// resourceProviderClient is an interface for mocking the generated SDK client for resource types.
// resourceTypeClient is an interface for mocking the generated SDK client for resource types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this. I'm just about to hit send on another PR that will touch this file, so I'll fix it then if that's OK.

pkg/cli/cmd/resourcetype/list/list.go Show resolved Hide resolved
@radius-functional-tests
Copy link

radius-functional-tests bot commented Nov 11, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository rynowak/radius
Commit ref 3840320
Unique ID funcfd90a707d9
Image tag pr-funcfd90a707d9
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-funcfd90a707d9
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-funcfd90a707d9
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funcfd90a707d9
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcfd90a707d9
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcfd90a707d9
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@rynowak rynowak merged commit 7e4d565 into radius-project:main Nov 12, 2024
29 checks passed
@rynowak rynowak deleted the udt-basic-commands branch November 12, 2024 00:54
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.

5 participants