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] add create resource type command #8104

Merged
merged 10 commits into from
Jan 8, 2025

Conversation

nithyatsu
Copy link
Contributor

@nithyatsu nithyatsu commented Dec 3, 2024

Description

add rad resource-type create

Type of change

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

Partially Fixes: #issue_number

Contributor checklist

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

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

@nithyatsu nithyatsu changed the title add create resource type command [UDT] add create resource type command Dec 5, 2024
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

Attention: Patch coverage is 35.29412% with 176 lines in your changes missing coverage. Please review.

Project coverage is 59.75%. Comparing base (3c28b26) to head (c6eb041).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cli/manifest/testclientfactory.go 27.36% 68 Missing and 1 partial ⚠️
pkg/cli/manifest/registermanifest.go 0.00% 54 Missing ⚠️
pkg/cli/cmd/resourcetype/create/create.go 64.22% 31 Missing and 8 partials ⚠️
pkg/cli/clivalidation.go 0.00% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8104      +/-   ##
==========================================
- Coverage   59.94%   59.75%   -0.19%     
==========================================
  Files         589      590       +1     
  Lines       39237    39487     +250     
==========================================
+ Hits        23519    23597      +78     
- Misses      13981    14146     +165     
- Partials     1737     1744       +7     

☔ 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 Jan 6, 2025

Radius functional test overview

🔍 Go to test action run

Name Value
Repository nithyatsu/radius
Commit ref 8b5d45f
Unique ID func00e91324c4
Image tag pr-func00e91324c4
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • 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-func00e91324c4
  • 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-func00e91324c4
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func00e91324c4
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func00e91324c4
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func00e91324c4
  • 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

@nithyatsu nithyatsu marked this pull request as ready for review January 6, 2025 23:57
@nithyatsu nithyatsu requested review from a team as code owners January 6, 2025 23:57
@nithyatsu nithyatsu temporarily deployed to functional-tests January 6, 2025 23:58 — with GitHub Actions Inactive
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 6, 2025

Radius functional test overview

🔍 Go to test action run

Name Value
Repository nithyatsu/radius
Commit ref 492c575
Unique ID funcb2077b2908
Image tag pr-funcb2077b2908
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • 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-funcb2077b2908
  • 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-funcb2077b2908
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funcb2077b2908
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcb2077b2908
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcb2077b2908
  • 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

@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 7, 2025

Radius functional test overview

🔍 Go to test action run

Name Value
Repository nithyatsu/radius
Commit ref 76430a0
Unique ID funcd265900b33
Image tag pr-funcd265900b33
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • 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-funcd265900b33
  • 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-funcd265900b33
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funcd265900b33
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcd265900b33
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcd265900b33
  • 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...
✅ corerp-cloud functional tests succeeded
✅ ucp-cloud functional tests succeeded

@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 7, 2025

Radius functional test overview

🔍 Go to test action run

Name Value
Repository nithyatsu/radius
Commit ref ed3c9d7
Unique ID func30c68be944
Image tag pr-func30c68be944
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • 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-func30c68be944
  • 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-func30c68be944
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func30c68be944
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func30c68be944
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func30c68be944
  • 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...
✅ corerp-cloud functional tests succeeded
✅ ucp-cloud functional tests succeeded

@nithyatsu nithyatsu requested a review from ytimocin January 7, 2025 21:57

// If resource provider does not exist or if there is any other error, first register the resource provider.
response, err := r.UCPClientFactory.NewResourceProvidersClient().Get(ctx, "local", r.ResourceProvider.Name, nil)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

The error can also be something other than Resource Provider not Found, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. Currently, if there are errors, approach is to recreate. @rynowak do you see any problems with this approach?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should only create if the error is 404 and fail if it is something else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added changes to return error if it is not 404.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should only create if the error is 404 and fail if it is something else.

Added changes to return error if it is not 404.


// If resource provider does not exist or if there is any other error, first register the resource provider.
response, err := r.UCPClientFactory.NewResourceProvidersClient().Get(ctx, "local", r.ResourceProvider.Name, nil)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should only create if the error is 404 and fail if it is something else.

@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 8, 2025

Radius functional test overview

🔍 Go to test action run

Name Value
Repository nithyatsu/radius
Commit ref 1469009
Unique ID funcc4e12f819f
Image tag pr-funcc4e12f819f
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • 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-funcc4e12f819f
  • 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-funcc4e12f819f
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funcc4e12f819f
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcc4e12f819f
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcc4e12f819f
  • 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

ytimocin
ytimocin previously approved these changes Jan 8, 2025
return err
}

// get the existing location resource and update it with new resource type. We have to revisit this code once schema is finalized and validated.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this comment is useful because it indicates revisiting the code once schema validation comes in.

@nithyatsu nithyatsu temporarily deployed to functional-tests January 8, 2025 23:02 — with GitHub Actions Inactive
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 8, 2025

Radius functional test overview

🔍 Go to test action run

Name Value
Repository nithyatsu/radius
Commit ref c6eb041
Unique ID funcb6e3034473
Image tag pr-funcb6e3034473
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • 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-funcb6e3034473
  • 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-funcb6e3034473
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funcb6e3034473
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcb6e3034473
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcb6e3034473
  • 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...
✅ corerp-cloud functional tests succeeded
✅ ucp-cloud functional tests succeeded

@nithyatsu nithyatsu merged commit 73ed52d into radius-project:main Jan 8, 2025
29 checks passed
@kachawla kachawla mentioned this pull request Feb 6, 2025
12 tasks
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.

4 participants