-
Notifications
You must be signed in to change notification settings - Fork 557
Correct use of system-scoped tokens in CI #3064
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
Conversation
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.
Thanks
@dtantsur for review, please |
We were setting OS_SYSTEM_SCOPE in some of the functional ironic tests. This was resulting in the following errors when attempting to create resources: Authentication cannot be scoped to multiple targets. Pick one of: project, domain, trust, system or unscoped Unfortunately, because we weren't setting 'errexit' ('set -e') this wasn't being noticed, but we can "correct" things now. I say "correct" because, adding to the misfortune, how we fix this is technically incorrect - you should have project-scoped configuration *or* system-scoped, not both - but since we don't yet have the infrastructure to switch between sets of auth info on a test-by-test basis, we need to do a Bad Thing. Hopefully this will be a short-lived thing. Signed-off-by: Stephen Finucane <[email protected]>
Signed-off-by: Stephen Finucane <[email protected]>
So the initial attempt at this failed CI because while some of our tests require system-scoped tokens, others require project-scoped tokens. I've removed some of the rework here and added a large |
Per the commit message in the first commit here, we are currently seeing the following error messages in some baremetal jobs:
The only reason these are not causing failures yet is because we're not setting
errexit
in the scripts. Once we do (as we're doing in #3046), we get failures.The fix is unset any project- or domain-specific envvars once we detect we are using system-scoped tokens.Edit: The fix is to set both configuration for both project- and system-scoped tokens but only after we've completed all of our OSC invocations, side-stepping the above issue.
We also run the whole script through shellcheck to prevent further issues like this creeping in.