Skip to content

Conversation

savitharaghunathan
Copy link
Member

@savitharaghunathan savitharaghunathan commented Dec 10, 2021

Adding support for service principal credential for Azure plugin

@savitharaghunathan savitharaghunathan marked this pull request as draft December 10, 2021 20:24
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 10, 2021
@openshift-ci
Copy link

openshift-ci bot commented Dec 11, 2021

@savitharaghunathan: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/operator-unit-test 3c45327 link true /test operator-unit-test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@savitharaghunathan
Copy link
Member Author

/test operator-unit-test

@openshift-ci
Copy link

openshift-ci bot commented Dec 13, 2021

@savitharaghunathan: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test 4.7-ci-index
  • /test 4.7-images
  • /test 4.7-operator-e2e
  • /test 4.7-operator-unit-test

Use /test all to run all jobs.

In response to this:

/test operator-unit-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.

@savitharaghunathan
Copy link
Member Author

/test 4.7-operator-unit-test

@savitharaghunathan
Copy link
Member Author

/test all

@savitharaghunathan savitharaghunathan requested review from shubham-pampattiwar and dymurray and removed request for shawn-hurley and rayfordj December 13, 2021 19:17
@savitharaghunathan savitharaghunathan marked this pull request as ready for review December 13, 2021 19:18
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 13, 2021
@dymurray
Copy link
Member

/retest

Copy link
Member

@shubham-pampattiwar shubham-pampattiwar left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @savitharaghunathan, changes look sane to me. Added some questions and Nits,

}
} else {
r.Log.Info("Checking for service principal credentials")
if len(azcreds.subscriptionID) == 0 && len(azcreds.tenantID) == 0 && len(azcreds.clientID) == 0 && len(azcreds.clientSecret) == 0 && len(azcreds.resourceGroup) == 0 {

Choose a reason for hiding this comment

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

Do we not need strorageAccountKey value as well for Service principal ?

Copy link
Member Author

Choose a reason for hiding this comment

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

we need strorageAccountKey. Hence checking for the one in bslspec. If the config parameter for storageAccountKeyEnvVar is not present, then service principal creds needs to be validated

Copy link
Member Author

Choose a reason for hiding this comment

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

Irresepctive of whatever method we need the strorageAccountKey in credential file.

Copy link
Member

Choose a reason for hiding this comment

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

just a NIT for this... when we have this many conditionals on an if statement looks better if you do:

if len(azcreds.subscriptionID) == 0 &&
    len(azcreds.tenantID) == 0 && 
    len(foo)
   ...

@savitharaghunathan savitharaghunathan changed the title Adding support for service principal credential support for Azure plugin Adding support for service principal credential for Azure plugin Dec 15, 2021
r.Log.Info(fmt.Sprintf("Azure storage key value after parsing: %s", AzureStorageKey))
continue
azcreds.strorageAccountKey = storageKeyValue
case matchedSubscriptionId:
Copy link
Member

Choose a reason for hiding this comment

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

Thiis looks great

@dymurray dymurray merged commit 2cbc2c9 into openshift:master Dec 15, 2021
@savitharaghunathan savitharaghunathan deleted the cred_azure branch December 15, 2021 16:46
kaovilai added a commit to kaovilai/oadp-operator that referenced this pull request Dec 22, 2021
* api v1 upgrade CR typo (openshift#501)

* Removing kube-rbac-proxy from the containers needed (openshift#504)

* fix indentation (openshift#505)

* turn OCP versions from int to string (openshift#502)

* Ensure velero is deleted (openshift#510)

* Timeout  for must-gather failed backups (openshift#497)

* Adding known limitations to must-gather

* Adding implementation details for timeout

* remove VSPHERE env configs for csv (openshift#512)

* update troubleshooting doc (openshift#509)

* Adding support for service principal credential for Azure plugin (openshift#507)

* Adding validation for azure creds

* Adding account key check

* Adding checks to validate SP if storage key is not present

* Adding unit test#1

* Adding a test case for service principal

* Adding review comments

* Remove: logging sensitive info

* make deploy velero namespace fix (openshift#506)

* make deploy velero namespace fix

* add changes for undeploy

* add deploy-tmp-cleanup

* fix aws registry env vars (openshift#515)

* Azure SP docs (openshift#514)

* Adding Azure SP related doc

* Fixing title

* Fixing nit

* Registry should not be deployed when Azure SP is used (openshift#518)

* Registry should not be deployed when Azure SP is used

* Fixing unit tests

* Adding review comments

* Fixing typos

* Adding registry label to BSL

* Updating azure credentials documentation (openshift#519)

* AWS plugin config: BSL Region not required when s3ForcePathStyle is false and BackupImages is false (openshift#517)

* OADP-153, Close openshift#424

* Nil restic Config should delete previous restic daemonset

* only check restic config if it is not nil

* installCase wantError implement

* Make err more verbose

* commit metav1

* Changes for BackupImages considerations

* fake client fix

* removed vsphere from source manager config (openshift#520)

* Update README.md

* badge relocate (openshift#521)

Co-authored-by: Tiger Kaovilai <[email protected]>
Co-authored-by: Shawn Hurley <[email protected]>
Co-authored-by: Emily McMullan <[email protected]>
Co-authored-by: Savitha Raghunathan <[email protected]>
Co-authored-by: Wesley Hayutin <[email protected]>
Co-authored-by: Dylan Murray <[email protected]>
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.

3 participants