Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 2 commits into from
May 28, 2024

Conversation

stephenfin
Copy link
Contributor

@stephenfin stephenfin commented May 28, 2024

Per the commit message in the first commit here, we are currently seeing the following error messages in some baremetal jobs:

Authentication cannot be scoped to multiple targets. Pick one of: project, domain, trust, system or unscoped

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.

@github-actions github-actions bot added the semver:patch No API change label May 28, 2024
@stephenfin
Copy link
Contributor Author

/cc @EmilienM @dtantsur This was the cause of the functional-baremetal failures in #3046.

EmilienM
EmilienM previously approved these changes May 28, 2024
Copy link
Contributor

@EmilienM EmilienM left a comment

Choose a reason for hiding this comment

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

Thanks

@coveralls
Copy link

coveralls commented May 28, 2024

Coverage Status

coverage: 78.696%. remained the same
when pulling b28bc4e on stephenfin:fix-scoping
into 930d18c on gophercloud:master.

@EmilienM
Copy link
Contributor

@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]>
@github-actions github-actions bot added semver:patch No API change and removed semver:patch No API change labels May 28, 2024
@stephenfin
Copy link
Contributor Author

stephenfin commented May 28, 2024

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 TODO to stackenv highlighting an ongoing issue and the potential long-term resolution (tl;dr: we need to start using clouds.yaml) which is probably worth looking at. Hopefully this gets things working for now though...

@EmilienM EmilienM merged commit 09c5d7c into gophercloud:master May 28, 2024
16 checks passed
@stephenfin stephenfin deleted the fix-scoping branch May 29, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch No API change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants