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

"rad credential register aws" command changes for irsa #7750

Conversation

vishwahiremat
Copy link
Contributor

Description

Updating the existing rad credential register aws command:

rad credential register aws --access-key-id <access-key-id> --secret-access-key <secret-access-key> should be replaced with rad credential register aws access-key --access-key-id <access-key-id> --secret-access-key <secret-access-key>

rad credential register aws irsa --iam-role <roleARN> should be supported.

Type of change

  • This pull request fixes a bug in Radius and has an approved issue (issue link required).
  • This pull request adds or changes features of Radius and has an approved issue (issue link required).
  • This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional).

Fixes: #issue_number

Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
@vishwahiremat vishwahiremat requested review from a team as code owners July 19, 2024 22:26
Copy link

codecov bot commented Jul 19, 2024

Codecov Report

Attention: Patch coverage is 71.06918% with 46 lines in your changes missing coverage. Please review.

Project coverage is 61.05%. Comparing base (81b89fd) to head (283a68f).

Files Patch % Lines
...cmd/credential/register/aws/accesskey/accesskey.go 81.08% 7 Missing and 7 partials ⚠️
pkg/cli/cmd/credential/register/aws/irsa/irsa.go 81.53% 6 Missing and 6 partials ⚠️
pkg/cli/cmd/credential/register/aws/aws.go 0.00% 11 Missing ⚠️
pkg/cli/cmd/credential/register/register.go 0.00% 5 Missing ⚠️
pkg/cli/cmd/credential/credential.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7750      +/-   ##
==========================================
- Coverage   61.06%   61.05%   -0.01%     
==========================================
  Files         521      523       +2     
  Lines       27276    27361      +85     
==========================================
+ Hits        16655    16706      +51     
- Misses       9157     9184      +27     
- Partials     1464     1471       +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 Jul 22, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository vishwahiremat/radius
Commit ref 500ac59
Unique ID funca2b58f3e0e
Image tag pr-funca2b58f3e0e
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.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-funca2b58f3e0e
  • 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-funca2b58f3e0e
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funca2b58f3e0e
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funca2b58f3e0e
  • 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...
❌ Failed to install Radius for corerp-cloud functional test. Please check the logs for more details
⌛ Starting ucp-cloud functional tests...
❌ corerp-cloud functional test failed. Please check the logs for more details
⌛ Starting datastoresrp-cloud functional tests...
❌ ucp-cloud functional test cancelled. Please check the logs for more details
❌ datastoresrp-cloud functional test cancelled. Please check the logs for more details

},
}

err = client.PutAWS(ctx, credential)
Copy link
Contributor

Choose a reason for hiding this comment

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

if we have access key credential configured, and run rad credential register, then we would just overwrite it, since we store exactly one credential which is "default" correct?

Copy link
Contributor

@nithyatsu nithyatsu left a comment

Choose a reason for hiding this comment

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

LGTM. would be great if @Reshrahim / @willtsai review the ux messages and are ok with them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Needs a rebase with main because this workflow doesn't exist anymore. The name has changed.

pkg/cli/cmd/credential/register/aws/accesskey/accesskey.go Outdated Show resolved Hide resolved
pkg/cli/cmd/credential/register/aws/accesskey/accesskey.go Outdated Show resolved Hide resolved
pkg/cli/cmd/credential/register/register.go Outdated Show resolved Hide resolved
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
rad credential register aws --access-key-id <access-key-id> --secret-access-key <secret-access-key>
# Register (Add or update) cloud provider credential for AWS with access key authentication.
rad credential register aws access-key --access-key-id <access-key-id> --secret-access-key <secret-access-key>
# Register (Add or update) cloud provider credential for AWS with IRSA.
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
# Register (Add or update) cloud provider credential for AWS with IRSA.
# Register (Add or update) cloud provider credential for AWS with IRSA (IAM Roles for Service Accounts).

Abbreviating IRSA wherever possible in docs would be helpful for the user

@Reshrahim
Copy link
Contributor

LGTM. would be great if @Reshrahim / @willtsai review the ux messages and are ok with them.

Just took a look and suggested abbreviation for IRSA in couple of places.

Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jul 26, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository vishwahiremat/radius
Commit ref 6c60fb1
Unique ID func7611f87dfa
Image tag pr-func7611f87dfa
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.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func7611f87dfa
  • 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-func7611f87dfa
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func7611f87dfa
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func7611f87dfa
  • 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 datastoresrp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
❌ Failed to install Radius for ucp-cloud functional test. Please check the logs for more details
❌ ucp-cloud functional test failed. Please check the logs for more details
❌ Failed to install Radius for datastoresrp-cloud functional test. Please check the logs for more details
❌ datastoresrp-cloud functional test failed. Please check the logs for more details
❌ corerp-cloud functional test cancelled. Please check the logs for more details

Comment on lines +121 to +124
return clierrors.Message("Access Key id %q cannot be empty.", r.AccessKeyID)
}
if r.SecretAccessKey == "" {
return clierrors.Message("Secret Access Key %q cannot be empty.", r.SecretAccessKey)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to print the empty AccessKey and AccessKeyID here? I mean why do we need %q here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the exisitng code for access-key type. we moved it to different file

if err != nil {
return err
}
credential := ucp.AwsCredentialResource{
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: extra line before this

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to add any other tests here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we havent changed anything for the access-key type. the tests were copied from the previously added tests.

Radius will use the provided IAM credential for all interactions with AWS.
` + common.LongDescriptionBlurb,
Example: `
# Register (Add or update) cloud provider credential for AWS with IAM authentication
Copy link
Contributor

Choose a reason for hiding this comment

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

We have the same information for both IRSA and Access Key. Is that 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.

updadted this documentation for ira kind

Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jul 26, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository vishwahiremat/radius
Commit ref 2d4dcc9
Unique ID funcd31c13758a
Image tag pr-funcd31c13758a
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.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-funcd31c13758a
  • 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-funcd31c13758a
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcd31c13758a
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcd31c13758a
  • 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 datastoresrp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
❌ Failed to install Radius for datastoresrp-cloud functional test. Please check the logs for more details
❌ datastoresrp-cloud functional test failed. Please check the logs for more details
❌ corerp-cloud functional test cancelled. Please check the logs for more details
❌ ucp-cloud functional test cancelled. Please check the logs for more details

Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jul 30, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository vishwahiremat/radius
Commit ref 283a68f
Unique ID func973a8ee04f
Image tag pr-func973a8ee04f
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.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func973a8ee04f
  • 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-func973a8ee04f
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func973a8ee04f
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func973a8ee04f
  • 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 datastoresrp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
❌ Failed to install Radius for datastoresrp-cloud functional test. Please check the logs for more details
❌ Failed to install Radius for ucp-cloud functional test. Please check the logs for more details
❌ datastoresrp-cloud functional test failed. Please check the logs for more details
❌ ucp-cloud functional test failed. Please check the logs for more details
❌ corerp-cloud functional test cancelled. Please check the logs for more details

@ytimocin ytimocin merged commit 9b564db into radius-project:main Jul 30, 2024
25 of 26 checks passed
Copy link
Contributor

@rynowak rynowak left a comment

Choose a reason for hiding this comment

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

:shipit:

Reshrahim pushed a commit to Reshrahim/radius that referenced this pull request Aug 27, 2024
…t#7750)

# Description

Updating the existing `rad credential register aws command`:

`rad credential register aws --access-key-id <access-key-id>
--secret-access-key <secret-access-key>` should be replaced with `rad
credential register aws access-key --access-key-id <access-key-id>
--secret-access-key <secret-access-key>`

`rad credential register aws irsa --iam-role <roleARN>` should be
supported.

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #issue_number

---------

Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Reshma Abdul Rahim <reshmarahim.abdul@microsoft.com>
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