Loaded k8s extension
This commit is contained in:
parent
e8f5f26afa
commit
bee6ccf09c
@ -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
|
||||
|
@ -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
|
||||
|
@ -34,3 +34,6 @@ class FlaskKubernetes:
|
||||
@property
|
||||
def corev1api(self) -> kubernetes.client.CoreV1Api:
|
||||
return kubernetes.client.CoreV1Api(self.connection)
|
||||
|
||||
|
||||
k8s = FlaskKubernetes()
|
Loading…
Reference in New Issue
Block a user