Skip to content

Commit

Permalink
Merge pull request #136 from jsmolar/jsmolar2
Browse files Browse the repository at this point in the history
Moved MatchExpression to objects
  • Loading branch information
pehala authored Oct 25, 2022
2 parents 8bb4c6e + 9d08c30 commit 11f3af7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
14 changes: 13 additions & 1 deletion testsuite/objects/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
"""Module containing base classes for common objects"""
import abc
from dataclasses import dataclass
from typing import Literal
from typing import Literal, List


@dataclass
class MatchExpression:
"""
Data class intended for defining K8 Label Selector expressions.
Used by selector.matchExpressions API key identity.
"""

operator: Literal["In", "NotIn", "Exists", "DoesNotExist"]
values: List[str]
key: str = "group"


@dataclass
Expand Down
18 changes: 3 additions & 15 deletions testsuite/openshift/objects/auth_config.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
"""AuthConfig CR object"""
from dataclasses import dataclass, asdict
from typing import Dict, Literal, List
from dataclasses import asdict
from typing import Dict, Literal

from testsuite.objects import Authorization, Rule
from testsuite.objects import Authorization, Rule, MatchExpression
from testsuite.openshift.client import OpenShiftClient
from testsuite.openshift.objects import OpenShiftObject, modify


@dataclass
class MatchExpression:
"""
Data class intended for defining K8 Label Selector expressions.
Used by selector.matchExpressions API key identity.
"""

operator: Literal["In", "NotIn", "Exists", "DoesNotExist"]
values: List[str]
key: str = "group"


class AuthConfig(OpenShiftObject, Authorization):
"""Represents AuthConfig CR from Authorino"""

Expand Down

0 comments on commit 11f3af7

Please sign in to comment.