-
Notifications
You must be signed in to change notification settings - Fork 64
test: Add test to verify model registry access for different users created from the run #283
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
Changes from 33 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
b6074c4
test: Add test to verify model registry access for different users
fege acb802b
ci: Merge branch 'main' of github.com:fege/opendatahub-tests into rba…
fege 5ddf96a
change: Add user to a group to gain the access permission
fege 3fe23e6
fix: typo in logs
fege 6fd0843
fix: remove users from group at the end of the run, remove utils func…
fege bcbce95
fix: test adding a new group
fege 736043b
change: add test to add single user
fege 1d2db68
ci: Merge branch 'main' of github.com:fege/opendatahub-tests into rba…
fege a382fc3
fix: apply review comments
fege 659323a
change: move creation of role to a fixture
fege 3ee143e
fix: be sure that the user is in the group
fege 7d60efe
ci: Merge branch 'main' of github.com:fege/opendatahub-tests into rba…
fege 2c6a2d3
change: refactor the code
fege 7e643ba
change: Add docstring
fege 28b80f7
ci: Merge branch 'main' of github.com:fege/opendatahub-tests into rba…
fege 79af41d
fix: correct usage of get_endpoint_from_mr_service
fege 538666f
change: Create idp and users to use in the test run
fege 2a1189d
change: use Group in the new_group utils
fege 450a899
fix: use Namespace
fege b5ae7f7
fix: add pytest marker
fege 593c693
ci: Merge branch 'main' of github.com:fege/opendatahub-tests into rba…
fege 5cf69c9
fix: address review comments
fege a8d9014
ci: Merge branch 'main' of github.com:fege/opendatahub-tests into rba…
fege 72260be
fix: remove no_collect mark and update tests
fege d172d9c
Merge branch 'main' into rbac_tests
dbasunag 32fad04
fix: change group and idp functions
fege c90d66c
change: use wrapper functions and re-arrange the code in utils
fege d1067d4
change: use wrapper functions and re-arrange the code in utils
fege b3328b0
change: remove check
fege 2099d45
ci: Merge branch 'main' of github.com:fege/opendatahub-tests into rba…
fege 1d0d469
fix: address comment
fege c0ded9f
fix: adjust docstring
fege 0f0b014
change: remove logs
fege e221ec2
ci: Merge branch 'main' of github.com:fege/opendatahub-tests into rba…
fege c6082f4
fix: change namespace
fege 603a22b
fix: fix wronge merge resolution
fege File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| from contextlib import contextmanager | ||
| from typing import Generator | ||
| from simple_logger.logger import get_logger | ||
| from kubernetes.dynamic import DynamicClient | ||
| from ocp_resources.group import Group | ||
|
|
||
| LOGGER = get_logger(name=__name__) | ||
|
|
||
|
|
||
| @contextmanager | ||
| def create_group( | ||
| admin_client: DynamicClient, | ||
| group_name: str, | ||
| users: list[str] | None = None, | ||
| wait_for_resource: bool = True, | ||
| ) -> Generator[str, None, None]: | ||
| """ | ||
| Factory function to create an OpenShift group with optional users. | ||
| Uses context manager to ensure proper cleanup. | ||
|
|
||
| Args: | ||
| admin_client: The admin client to use for group operations | ||
| group_name: Name of the group to create | ||
| users: Optional list of usernames to add to the group | ||
| wait_for_resource: Whether to wait for the group to be ready | ||
|
|
||
| Yields: | ||
| The group name | ||
| """ | ||
| with Group( | ||
| client=admin_client, | ||
| name=group_name, | ||
| users=users or [], | ||
| wait_for_resource=wait_for_resource, | ||
| ) as _: | ||
| LOGGER.info(f"Group {group_name} created successfully.") | ||
| yield group_name |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.