Loaded k8s extension

This commit is contained in:
Pünkösd Marcell 2021-04-18 15:13:50 +02:00
parent e8f5f26afa
commit bee6ccf09c
3 changed files with 8 additions and 1 deletions

View File

@ -4,7 +4,7 @@ import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration
from flask import Flask
from utils import register_all_error_handlers
from utils import register_all_error_handlers, k8s
# import views
from views import JobView
@ -23,6 +23,9 @@ if Config.SENTRY_DSN:
# create flask app
app = Flask(__name__)
app.config.from_object(Config)
k8s.init_app(app)
register_all_error_handlers(app)
# register views

View File

@ -1,3 +1,4 @@
#!/usr/bin/env python3
from .require_decorators import json_required
from .error_handlers import register_all_error_handlers
from .kubernetes_adapter import FlaskKubernetes, k8s

View File

@ -34,3 +34,6 @@ class FlaskKubernetes:
@property
def corev1api(self) -> kubernetes.client.CoreV1Api:
return kubernetes.client.CoreV1Api(self.connection)
k8s = FlaskKubernetes()