Skip to content
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

PMR: use correct capitalisation on user kind #43

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/profiles_management/pmr/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ class ResourceQuotaSpecModel(BaseModel):
class UserKind(StrEnum):
"""Class representing the kind of the user as a Profile owner."""

USER = "user"
SERVICE_ACCOUNT = "service-account"
USER = "User"
SERVICE_ACCOUNT = "ServiceAccount"


class ContributorRole(StrEnum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pytest
from lightkube import Client
from lightkube.resources.rbac_authorization_v1 import RoleBinding

from profiles_management.create_or_update import create_or_update_profiles
from profiles_management.pmr import classes
Expand Down Expand Up @@ -73,7 +74,13 @@ async def test_new_profiles_created(lightkube_client: Client):
created_profile_quota = classes.ResourceQuotaSpecModel.model_validate(
created_profile["spec"]["resourceQuotaSpec"]
)

assert created_profile_quota == expected_quota
assert lightkube_client.get(RoleBinding, namespace=user, name="namespaceAdmin")
assert lightkube_client.get(
kfam.AuthorizationPolicy, namespace=user, name="ns-owner-access-istio"
)

profiles.remove_profile(created_profile, lightkube_client)


Expand Down
4 changes: 2 additions & 2 deletions tests/samples/pmr-sample-full.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
profiles:
- name: ml-engineers
owner:
kind: user
kind: User
name: [email protected]
resources:
hard:
Expand All @@ -15,7 +15,7 @@ profiles:
role: view
- name: data-engineers
owner:
kind: user
kind: User
name: [email protected]
contributors:
- name: [email protected]
Expand Down
2 changes: 1 addition & 1 deletion tests/samples/pmr-sample-single.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
profiles:
- name: ml-engineers
owner:
kind: user
kind: User
name: [email protected]
resources:
hard:
Expand Down
Loading