Skip to content

Commit

Permalink
chore(controller): bump gateway api v1
Browse files Browse the repository at this point in the history
  • Loading branch information
duanhongyi committed Jan 29, 2024
1 parent 98c598e commit be3d458
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions rootfs/scheduler/resources/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@

class Gateway(Resource):
api_prefix = 'apis'
api_version = 'gateway.networking.k8s.io/v1beta1'
api_version = 'gateway.networking.k8s.io/v1'

def manifest(self, namespace, name, **kwargs):
data = {
"apiVersion": self.api_version,
"kind": "Gateway",
"metadata": {
"name": name,
"namespace": namespace
"namespace": namespace,
"annotations": {
"cert-manager.io/issuer": namespace
},
},
"spec": {
"gatewayClassName": kwargs.get("gateway_class", "default"),
Expand Down Expand Up @@ -72,7 +75,7 @@ def delete(self, namespace, name, ignore_exception=True):

class Route(Resource):
api_prefix = 'apis'
api_version = 'gateway.networking.k8s.io/v1beta1'
api_version = 'gateway.networking.k8s.io/v1'

def manifest(self, namespace, name, **kwargs):
data = {
Expand Down Expand Up @@ -150,7 +153,7 @@ class UDPRoute(Route):

class HTTPRoute(Route):
kind = "HTTPRoute"
api_version = 'gateway.networking.k8s.io/v1beta1'
api_version = 'gateway.networking.k8s.io/v1'

def manifest(self, namespace, name, **kwargs):
data = super().manifest(namespace, name, **kwargs)
Expand All @@ -161,7 +164,7 @@ def manifest(self, namespace, name, **kwargs):

class GRPCRoute(Route):
kind = "GRPCRoute"
api_version = 'gateway.networking.k8s.io/v1beta1'
api_version = 'gateway.networking.k8s.io/v1alpha2'

def manifest(self, namespace, name, **kwargs):
data = super().manifest(namespace, name, **kwargs)
Expand All @@ -172,7 +175,7 @@ def manifest(self, namespace, name, **kwargs):

class TLSRoute(Route):
kind = "GRPCRoute"
api_version = 'gateway.networking.k8s.io/v1beta1'
api_version = 'gateway.networking.k8s.io/v1alpha2'

def manifest(self, namespace, name, **kwargs):
data = super().manifest(namespace, name, **kwargs)
Expand Down

0 comments on commit be3d458

Please sign in to comment.