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

Refactored GetCredentials Method #1451

Merged
merged 1 commit into from
Mar 29, 2022

Conversation

VibhorChinda
Copy link
Contributor

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes # Breaks down the GetCredentials method into ValidateIdentity, CreateSecretKey, GetKey, GetNamespceKey

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:


@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 18, 2022

CLA Signed

The committers are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Feb 18, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @VibhorChinda!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-vsphere 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-vsphere has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 18, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @VibhorChinda. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Feb 18, 2022
@geetikabatra
Copy link
Contributor

/ok-to-test

@k8s-ci-robot
Copy link
Contributor

@geetikabatra: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/ok-to-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@geetikabatra
Copy link
Contributor

You might want to sign off this PR.
Do and force push the change: git commit --amend --signoff

@VibhorChinda
Copy link
Contributor Author

You might want to sign off this PR. Do and force push the change: git commit --amend --signoff

@geetikabatra is this alright ?

@aartij17
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 18, 2022
@VibhorChinda
Copy link
Contributor Author

@geetikabatra @aartij17 does failing test means the code is breaking somewhere and need to be looked upon ?
Need some feedback and direction on this please.
Thanks ✌️

@geetikabatra
Copy link
Contributor

@VibhorChinda Yes, you might want to run make test to check if the tests pass in your local.
Also, could you write unit tests for the changes you made above?

secret := &apiv1.Secret{}
var secretKey client.ObjectKey

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 extra line

pkg/identity/identity.go Show resolved Hide resolved
pkg/identity/identity.go Outdated Show resolved Hide resolved
@VibhorChinda
Copy link
Contributor Author

@VibhorChinda Yes, you might want to run make test to check if the tests pass in your local. Also, could you write unit tests for the changes you made above?

Ok will do that.
Yes, I will work on creating unit tests now. ✌️

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 21, 2022
@VibhorChinda VibhorChinda changed the title Refactored GetCredentials Method [WIP] Refactored GetCredentials Method Feb 21, 2022
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 21, 2022
pkg/identity/identity.go Outdated Show resolved Hide resolved
pkg/identity/identity.go Outdated Show resolved Hide resolved
pkg/identity/identity.go Outdated Show resolved Hide resolved
pkg/identity/identity.go Outdated Show resolved Hide resolved
pkg/identity/identity.go Outdated Show resolved Hide resolved
pkg/identity/identity.go Outdated Show resolved Hide resolved
pkg/identity/identity.go Outdated Show resolved Hide resolved
pkg/identity/identity.go Outdated Show resolved Hide resolved
pkg/identity/identity.go Outdated Show resolved Hide resolved
pkg/identity/identity.go Outdated Show resolved Hide resolved
@VibhorChinda
Copy link
Contributor Author

VibhorChinda commented Feb 23, 2022

@srm09 will do all the changes being asked.
Just to be sure, only "ValidateInput" method should be created in this PR and test for that should be written right ?

I created all these methods because the Issue description asked [https://github.com//issues/1441] to do so.

@k8s-ci-robot k8s-ci-robot removed the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 26, 2022
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 26, 2022
@VibhorChinda VibhorChinda changed the title [WIP] Refactored GetCredentials Method Refactored GetCredentials Method Feb 26, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 26, 2022
@VibhorChinda
Copy link
Contributor Author

@geetikabatra @srm09 @aartij17 please check :)

@aartij17
Copy link
Contributor

aartij17 commented Mar 7, 2022

@VibhorChinda Can you take a look at the failed lint test. You can use ctx as the first argument to the function validateInputs

@VibhorChinda VibhorChinda force-pushed the Vibhor branch 2 times, most recently from 11bb6c1 to 7b470c6 Compare March 8, 2022 13:08
@VibhorChinda
Copy link
Contributor Author

/retest

@VibhorChinda
Copy link
Contributor Author

@geetikabatra @srm09 @aartij17 please check :)

@VibhorChinda VibhorChinda requested a review from srm09 March 8, 2022 13:35
pkg/identity/identity_test.go Outdated Show resolved Hide resolved
pkg/identity/identity_test.go Outdated Show resolved Hide resolved
pkg/identity/identity_test.go Outdated Show resolved Hide resolved
pkg/identity/identity_test.go Outdated Show resolved Hide resolved
@VibhorChinda VibhorChinda requested a review from srm09 March 15, 2022 18:05
@aartij17
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 28, 2022
@geetikabatra
Copy link
Contributor

/lgtm

@k8s-ci-robot
Copy link
Contributor

@geetikabatra: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@yastij yastij left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yastij

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 29, 2022
@VibhorChinda
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit aae2231 into kubernetes-sigs:main Mar 29, 2022
@VibhorChinda
Copy link
Contributor Author

First CAPV PR merged 🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants