Skip to content

Commit

Permalink
Merge pull request Kuadrant#484 from pehala/reorg_kube
Browse files Browse the repository at this point in the history
Reorganize kubernetes package
  • Loading branch information
averevki authored Jul 11, 2024
2 parents e98eda7 + 12948ee commit d6499c9
Show file tree
Hide file tree
Showing 86 changed files with 98 additions and 103 deletions.
2 changes: 1 addition & 1 deletion testsuite/gateway/envoy/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
if typing.TYPE_CHECKING:
from testsuite.kubernetes.client import KubernetesClient
from testsuite.backend import Backend
from testsuite.policy.authorization.auth_config import AuthConfig
from testsuite.kuadrant.policy.authorization.auth_config import AuthConfig


class EnvoyVirtualRoute(GatewayRoute):
Expand Down
2 changes: 1 addition & 1 deletion testsuite/gateway/exposers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from testsuite.certificates import Certificate
from testsuite.gateway import Exposer, Gateway, Hostname
from testsuite.httpx import KuadrantClient, ForceSNIClient
from testsuite.kubernetes.route import OpenshiftRoute
from testsuite.kubernetes.openshift.route import OpenshiftRoute


class OpenShiftExposer(Exposer):
Expand Down
2 changes: 1 addition & 1 deletion testsuite/gateway/gateway_api/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from testsuite.gateway import Gateway
from testsuite.kubernetes.client import KubernetesClient
from testsuite.kubernetes import KubernetesObject
from testsuite.policy import Policy
from testsuite.kuadrant.policy import Policy
from testsuite.utils import check_condition


Expand Down
2 changes: 1 addition & 1 deletion testsuite/gateway/gateway_api/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from testsuite.gateway import Gateway, GatewayRoute, PathMatch, MatchType, RouteMatch
from testsuite.kubernetes.client import KubernetesClient
from testsuite.kubernetes import KubernetesObject, modify
from testsuite.policy import Policy
from testsuite.kuadrant.policy import Policy
from testsuite.utils import asdict, check_condition

if typing.TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Kuadrant CR object"""
"""Kuadrant CR"""

import dataclasses

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import Literal, Iterable, TYPE_CHECKING, Union

from testsuite.policy.authorization import (
from testsuite.kuadrant.policy.authorization import (
Credentials,
Rule,
Pattern,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from testsuite.gateway import Referencable
from testsuite.kubernetes.client import KubernetesClient
from testsuite.policy import Policy
from testsuite.kuadrant.policy import Policy


class DNSPolicy(Policy):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from testsuite.gateway import Referencable, RouteMatch
from testsuite.kubernetes import modify
from testsuite.kubernetes.client import KubernetesClient
from testsuite.policy import Policy
from testsuite.policy.authorization import Rule
from testsuite.kuadrant.policy import Policy
from testsuite.kuadrant.policy.authorization import Rule
from testsuite.utils import asdict


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from testsuite.gateway import Referencable
from testsuite.kubernetes.client import KubernetesClient
from testsuite.policy import Policy, has_condition
from testsuite.kuadrant.policy import Policy, has_condition


class TLSPolicy(Policy):
Expand Down
2 changes: 1 addition & 1 deletion testsuite/kubernetes/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import openshift_client as oc
from openshift_client import Context, OpenShiftPythonException

from .route import OpenshiftRoute
from testsuite.kubernetes.openshift.route import OpenshiftRoute
from .secret import Secret


Expand Down
6 changes: 0 additions & 6 deletions testsuite/kubernetes/metrics/__init__.py

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Module containing Route related stuff"""
"""Module containing OpenShift Route"""

from functools import cached_property

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from apyproxy import ApyProxy
from httpx import Client

from .service_monitor import ServiceMonitor
from testsuite.kubernetes.service_monitor import ServiceMonitor


def _params(key: str = "", labels: dict[str, str] = None) -> dict[str, str]:
Expand Down
2 changes: 1 addition & 1 deletion testsuite/tests/kuadrantctl/cli/test_simple_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from testsuite.httpx.auth import HttpxOidcClientAuth
from testsuite.oas import as_tmp_file
from testsuite.policy.authorization.auth_policy import AuthPolicy
from testsuite.kuadrant.policy.authorization.auth_policy import AuthPolicy


@pytest.fixture(scope="module")
Expand Down
2 changes: 1 addition & 1 deletion testsuite/tests/kuadrantctl/cli/test_simple_limit.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest

from testsuite.oas import as_tmp_file
from testsuite.policy.rate_limit_policy import Limit, RateLimitPolicy
from testsuite.kuadrant.policy.rate_limit import Limit, RateLimitPolicy
from testsuite.utils import asdict


Expand Down
6 changes: 3 additions & 3 deletions testsuite/tests/multicluster/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
from testsuite.gateway.gateway_api.hostname import DNSPolicyExposer
from testsuite.gateway.gateway_api.route import HTTPRoute
from testsuite.kubernetes.client import KubernetesClient
from testsuite.policy import Policy
from testsuite.policy.dns_policy import DNSPolicy
from testsuite.policy.tls_policy import TLSPolicy
from testsuite.kuadrant.policy import Policy
from testsuite.kuadrant.policy.dns import DNSPolicy
from testsuite.kuadrant.policy.tls import TLSPolicy


AnyPolicy = TypeVar("AnyPolicy", bound=Policy)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from keycloak import KeycloakOpenIDConnection, KeycloakUMA

from testsuite.httpx.auth import HttpxOidcClientAuth
from testsuite.policy.authorization import JsonResponse, ValueFrom, Pattern
from testsuite.kuadrant.policy.authorization import JsonResponse, ValueFrom, Pattern

pytestmark = [pytest.mark.authorino]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from testsuite.policy.authorization import ValueFrom, Cache
from testsuite.kuadrant.policy.authorization import ValueFrom, Cache
from testsuite.utils import extract_response

pytestmark = [pytest.mark.authorino]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest

from testsuite.policy.authorization import ValueFrom, Cache
from testsuite.kuadrant.policy.authorization import ValueFrom, Cache
from testsuite.utils import extract_response

pytestmark = [pytest.mark.authorino]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from testsuite.policy.authorization import Pattern
from testsuite.kuadrant.policy.authorization import Pattern

pytestmark = [pytest.mark.authorino]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from testsuite.policy.authorization import Pattern
from testsuite.kuadrant.policy.authorization import Pattern
from testsuite.httpx.auth import HeaderApiKeyAuth

pytestmark = [pytest.mark.authorino]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from testsuite.policy.authorization import Pattern
from testsuite.kuadrant.policy.authorization import Pattern

pytestmark = [pytest.mark.authorino]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from testsuite.policy.authorization import Pattern, Value, JsonResponse
from testsuite.kuadrant.policy.authorization import Pattern, Value, JsonResponse
from testsuite.utils import extract_response

pytestmark = [pytest.mark.authorino]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from testsuite.policy.authorization import Pattern, PatternRef, AnyPattern, AllPattern
from testsuite.kuadrant.policy.authorization import Pattern, PatternRef, AnyPattern, AllPattern

pytestmark = [pytest.mark.authorino]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from testsuite.policy.authorization import Pattern
from testsuite.kuadrant.policy.authorization import Pattern

pytestmark = [pytest.mark.authorino]

Expand Down
4 changes: 2 additions & 2 deletions testsuite/tests/singlecluster/authorino/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from testsuite.httpx.auth import HttpxOidcClientAuth
from testsuite.kubernetes.client import KubernetesClient
from testsuite.kubernetes.api_key import APIKey
from testsuite.policy.authorization.auth_config import AuthConfig
from testsuite.kubernetes.authorino import AuthorinoCR, Authorino, PreexistingAuthorino
from testsuite.kuadrant.policy.authorization.auth_config import AuthConfig
from testsuite.kuadrant.authorino import AuthorinoCR, Authorino, PreexistingAuthorino


@pytest.fixture(scope="session")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from testsuite.httpx.auth import HttpxOidcClientAuth
from testsuite.oidc.keycloak import Keycloak
from testsuite.utils import ContentType
from testsuite.policy.authorization import Pattern, PatternRef, Value, ValueFrom, DenyResponse
from testsuite.kuadrant.policy.authorization import Pattern, PatternRef, Value, ValueFrom, DenyResponse


@pytest.fixture(scope="session")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from testsuite.policy.authorization import Credentials
from testsuite.kuadrant.policy.authorization import Credentials

pytestmark = [pytest.mark.authorino]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from testsuite.policy.authorization import Value, ValueFrom
from testsuite.kuadrant.policy.authorization import Value, ValueFrom
from testsuite.utils import extract_response

pytestmark = [pytest.mark.authorino]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from testsuite.policy.authorization import Value
from testsuite.kuadrant.policy.authorization import Value
from testsuite.utils import extract_response

pytestmark = [pytest.mark.authorino]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""https://github.com/Kuadrant/authorino/blob/main/docs/user-guides/token-normalization.md"""

import pytest
from testsuite.policy.authorization import Pattern, Value, ValueFrom
from testsuite.kuadrant.policy.authorization import Pattern, Value, ValueFrom
from testsuite.httpx.auth import HeaderApiKeyAuth, HttpxOidcClientAuth

pytestmark = [pytest.mark.authorino]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from testsuite.policy.authorization import Credentials
from testsuite.kuadrant.policy.authorization import Credentials

pytestmark = [pytest.mark.authorino]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import pytest

from testsuite.policy.authorization import ValueFrom, JsonResponse
from testsuite.kuadrant.policy.authorization import ValueFrom, JsonResponse

pytestmark = [pytest.mark.authorino]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest

from testsuite.httpx.auth import HttpxOidcClientAuth
from testsuite.policy.authorization import Pattern
from testsuite.kuadrant.policy.authorization import Pattern

pytestmark = [pytest.mark.authorino]

Expand Down
3 changes: 2 additions & 1 deletion testsuite/tests/singlecluster/authorino/metrics/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
from testsuite.gateway.envoy import Envoy
from testsuite.httpx import KuadrantClient
from testsuite.kubernetes.config_map import ConfigMap
from testsuite.kubernetes.metrics import ServiceMonitor, MetricsEndpoint, Prometheus
from testsuite.kubernetes.service_monitor import ServiceMonitor, MetricsEndpoint
from testsuite.prometheus import Prometheus


@pytest.fixture(scope="module")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from testsuite.policy.authorization import Value, JsonResponse
from testsuite.kuadrant.policy.authorization import Value, JsonResponse

pytestmark = [pytest.mark.authorino, pytest.mark.standalone_only]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest

from testsuite.gateway.envoy.route import EnvoyVirtualRoute
from testsuite.policy.authorization.auth_config import AuthConfig
from testsuite.kuadrant.policy.authorization.auth_config import AuthConfig


@pytest.fixture(scope="module")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import pytest

from testsuite.policy.authorization import Value, JsonResponse
from testsuite.policy.authorization.auth_config import AuthConfig
from testsuite.kuadrant.policy.authorization import Value, JsonResponse
from testsuite.kuadrant.policy.authorization.auth_config import AuthConfig

pytestmark = [pytest.mark.authorino, pytest.mark.standalone_only]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest

from testsuite.gateway.envoy import Envoy
from testsuite.kubernetes.authorino import AuthorinoCR, Authorino
from testsuite.kuadrant.authorino import AuthorinoCR, Authorino


@pytest.fixture(scope="module")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import pytest

from testsuite.gateway.exposers import LoadBalancerServiceExposer
from testsuite.policy.authorization import Value, JsonResponse
from testsuite.kuadrant.policy.authorization import Value, JsonResponse
from testsuite.httpx import KuadrantClient
from testsuite.policy.authorization.auth_config import AuthConfig
from testsuite.kubernetes.route import OpenshiftRoute
from testsuite.kuadrant.policy.authorization.auth_config import AuthConfig
from testsuite.kubernetes.openshift.route import OpenshiftRoute


@pytest.fixture(scope="module")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import pytest

from testsuite.policy.authorization import Value, JsonResponse
from testsuite.kuadrant.policy.authorization import Value, JsonResponse
from testsuite.gateway.envoy import Envoy
from testsuite.policy.authorization.auth_config import AuthConfig
from testsuite.kuadrant.policy.authorization.auth_config import AuthConfig
from testsuite.gateway.envoy.route import EnvoyVirtualRoute


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest
from weakget import weakget

from testsuite.kubernetes.authorino import AuthorinoCR
from testsuite.kuadrant.authorino import AuthorinoCR

pytestmark = [pytest.mark.authorino, pytest.mark.standalone_only]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest

from testsuite.policy.authorization.auth_config import AuthConfig
from testsuite.kuadrant.policy.authorization.auth_config import AuthConfig

pytestmark = [pytest.mark.authorino, pytest.mark.standalone_only]

Expand Down
Loading

0 comments on commit d6499c9

Please sign in to comment.