-
Notifications
You must be signed in to change notification settings - Fork 64
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
ci: update azure SP federated credentials #1442
ci: update azure SP federated credentials #1442
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1442 +/- ##
==========================================
+ Coverage 66.76% 68.16% +1.39%
==========================================
Files 116 119 +3
Lines 6030 6134 +104
==========================================
+ Hits 4026 4181 +155
+ Misses 1620 1559 -61
- Partials 384 394 +10 ☔ View full report in Codecov by Sentry. |
.github/workflows/build-pr.yml
Outdated
@@ -69,6 +69,7 @@ jobs: | |||
permissions: | |||
id-token: write | |||
contents: read | |||
environment: aks-deploy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was mentioned during the Meeting (but i forgot sorry) , could you remind me how the environment property is used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without the env, will the cached token be accessible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Environment are a github construct to represent a target deployment type. So testing, dev, prod, etc. In the environment, you can setup workflows, secrets, and variables that target that environment. So in our case, we would define a new environement azure-test
and this environment contains all the necessary creds for our azure e2e tests. Read more about environments here.
In our workflows, we use Azure/login
action to auth. The federated credential accepts environment
as one of the scopes for federated credential. This means for each unique <org>/ratify
combination, we could setup one federated credential that will target an environment azure-test
. This means that for deislabs
we'd have one cred and for each person's fork we would have another. There are other scopes supported for federated credentials like branches however it becomes cumbersome if we want to manually trigger tests from a specific feature branch. This is why environment is helpful.
Now there is some downside (potentially) for using environment. Now, the new environment will show up on the main github repository name.
And what's unfortunate is that for each aks run, it generates 6 entries under Deployments
and if there are failures in the latest
one (this seems arbitrary what is latest of the matrix), then the deployment shows as failed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in conclusion we have 2 options for federated credential scope.
- Use branch scope. This means it'll be very cumbersome to trigger AKS tests directly from a feature branch. We would need to settle on the
dev
branch to run all tests on your fork. - Use environments with the failure reporting following the screenshots above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. thanks for the update! just a question , but just for learning purposes. (FYI, Binbin is investigating a aks e2e test failure)
@susanshi Here are some findings on current state of the aks test cleanup:
I'm thinking maybe this cleanup optimization is out of scope for this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
Thanks for the investigation. We added the cleanup job because the cleanup() function could be skipped. I agree it's not in scope of this PR, we can fix it later. |
Signed-off-by: akashsinghal <[email protected]>
Description
What this PR does / why we need it:
This PR migrates the Azure SPN used for AKS e2e tests to use federated identities via OIDC
aks-deploy
environment for jobs that require azure authOnce PR merges to dev:
aks-deploy
Which issue(s) this PR fixes (optional, using
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when the PR gets merged):Fixes #1435
Type of change
Please delete options that are not relevant.
main
branch)How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration
Checklist:
Post Merge Requirements
Helm Chart Change