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

Adding rad init command changes to support irsa #7761

Merged

Conversation

vishwahiremat
Copy link
Contributor

Description

  • Added changes to rad init --full command to add types i.e accesskey,irsa while configuring aws provider
    image
  • And adding prompts to accept role arn
  • refactoring the code with switch cases to handle it differently for both cases.
  • updated the tests

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 24, 2024 16:49
Copy link

codecov bot commented Jul 24, 2024

Codecov Report

Attention: Patch coverage is 67.34694% with 32 lines in your changes missing coverage. Please review.

Project coverage is 61.04%. Comparing base (4ba025d) to head (32a37e7).

Files Patch % Lines
pkg/cli/cmd/radinit/aws.go 70.90% 9 Missing and 7 partials ⚠️
pkg/cli/cmd/radinit/display.go 0.00% 12 Missing ⚠️
pkg/cli/cmd/radinit/environment.go 50.00% 1 Missing and 1 partial ⚠️
pkg/cli/cmd/radinit/init.go 92.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7761      +/-   ##
==========================================
- Coverage   61.05%   61.04%   -0.02%     
==========================================
  Files         523      523              
  Lines       27367    27432      +65     
==========================================
+ Hits        16710    16745      +35     
- Misses       9185     9207      +22     
- Partials     1472     1480       +8     

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

pkg/cli/aws/client.go Outdated Show resolved Hide resolved
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jul 25, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository vishwahiremat/radius
Commit ref 660e1ae
Unique ID func8c23a1ca6e
Image tag pr-func8c23a1ca6e
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-func8c23a1ca6e
  • 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-func8c23a1ca6e
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func8c23a1ca6e
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func8c23a1ca6e
  • 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...
✅ datastoresrp-cloud functional tests succeeded
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
@vishwahiremat vishwahiremat marked this pull request as draft July 30, 2024 21:56
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
@vishwahiremat vishwahiremat marked this pull request as ready for review August 6, 2024 19:53
@radius-functional-tests
Copy link

radius-functional-tests bot commented Aug 6, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository vishwahiremat/radius
Commit ref cdae1e8
Unique ID funcb9636dc38f
Image tag pr-funcb9636dc38f
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-funcb9636dc38f
  • 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-funcb9636dc38f
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcb9636dc38f
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcb9636dc38f
  • 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...
⌛ Starting datastoresrp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ datastoresrp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

Comment on lines 19 to 20
// AwsCredentialKind - Aws credential kinds supported.
type AwsCredentialKind string
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the convention in our repository for Aws? Should it be AWS or do we use both Aws and AWS? I believe we should use AWS.

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 see we are using mix of these 2 formats, mostly i see Aws in ucp code and AWS on the cli side. I have updated it to AWS format

pkg/cli/aws/provider.go Show resolved Hide resolved
pkg/cli/azure/provider.go Show resolved Hide resolved
Comment on lines 31 to 32
selectAWSRegionPrompt = "Select the region you would like to deploy AWS resources to:"
selectAwsCredentialKindPrompt = "Select a credential kind for the AWS credential:"
Copy link
Contributor

Choose a reason for hiding this comment

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

We use AWS and Aws in two lines that follow each other.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated it

pkg/cli/cmd/radinit/aws.go Show resolved Hide resolved
return nil, err
}

// Set the value for the Helm chart
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need these comments in production, I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

today i see comments in azure provider section as well, we can remove it if its not recommended https://github.com/vishwahiremat/radius/blob/b7484430568763f05fba769b325e6f0471092fcb/pkg/cli/cmd/radinit/azure.go#L127-L128

return r.Prompter.GetListInput(credentialKinds, selectAwsCredentialKindPrompt)
}

func (r *Runner) buildAwsCredentialKind() ([]string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This returns a list of available AWS credential kinds. Should we change the name? Also, can this ever return an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated it to remove error from the return type.
and for the name today we follow the similar format in azure provider:

func (r *Runner) buildAzureCredentialKind() ([]string, error) {

pkg/cli/cmd/radinit/environment.go Show resolved Hide resolved
Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
return r.Prompter.GetListInput(credentialKinds, selectAWSCredentialKindPrompt)
}

func (r *Runner) buildAWSCredentialKind() []string {
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we can also change the name of the function. Are we building something here? Is this the convention we are using? Isn't it more like awsCredentialKinds?

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 format we used in azure, we are using the similar format in azure provider.

@radius-functional-tests
Copy link

radius-functional-tests bot commented Aug 6, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository vishwahiremat/radius
Commit ref 32a37e7
Unique ID funcbdc2886d8b
Image tag pr-funcbdc2886d8b
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-funcbdc2886d8b
  • 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-funcbdc2886d8b
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcbdc2886d8b
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcbdc2886d8b
  • 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 datastoresrp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ corerp-cloud functional tests succeeded
✅ datastoresrp-cloud functional tests succeeded
✅ ucp-cloud functional tests succeeded

@sk593 sk593 merged commit a4a4b90 into radius-project:main Aug 6, 2024
26 checks passed
superbeeny pushed a commit to superbeeny/radius that referenced this pull request Aug 14, 2024
# Description

- Added changes to `rad init --full` command to add types i.e
accesskey,irsa while configuring aws provider

![image](https://github.com/user-attachments/assets/da396b4d-5877-4772-a247-9ef6cf0c9e79)
- And adding prompts to accept role arn
- refactoring the code with switch cases to handle it differently for
both cases.
- updated the tests


## 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>
Reshrahim pushed a commit to Reshrahim/radius that referenced this pull request Aug 27, 2024
# Description

- Added changes to `rad init --full` command to add types i.e
accesskey,irsa while configuring aws provider

![image](https://github.com/user-attachments/assets/da396b4d-5877-4772-a247-9ef6cf0c9e79)
- And adding prompts to accept role arn
- refactoring the code with switch cases to handle it differently for
both cases.
- updated the tests

## 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