Skip to content

Commit

Permalink
Add GatewayAPI ReferenceGrant object implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
averevki committed Dec 22, 2023
1 parent 27541ab commit b9cb606
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions testsuite/gateway/gateway_api/reference_grant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""Module with ReferenceGrant Gateway API object"""
from testsuite.openshift import OpenShiftObject
from testsuite.openshift.client import OpenShiftClient


class ReferenceGrant(OpenShiftObject):
"""ReferenceGrant Gateway API object"""

@classmethod
def create_instance(
cls, openshift_from: OpenShiftClient, openshift_to: OpenShiftClient, name: str, labels: dict[str, str]
):
"""Creates new instance of ReferenceGrant"""

model = {
"apiVersion": "gateway.networking.k8s.io/v1beta1",
"kind": "ReferenceGrant",
"metadata": {"name": name, "labels": labels},
"spec": {
"from": [
{
"group": "gateway.networking.k8s.io",
"kind": "HTTPRoute",
"namespace": openshift_from.project,
}
],
"to": [
{
"group": "",
"kind": "Service",
}
],
},
}

return cls(model, context=openshift_to.context)

0 comments on commit b9cb606

Please sign in to comment.