Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sub]fix: add ca-certificate creation on startup #885

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions backend/substrapp/apps.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import kubernetes

from django.apps import AppConfig
from django.conf import settings
from django.db.models.signals import post_delete

from substrapp.kubernetes_utils import create_replace_private_ca_secret


class SubstrappConfig(AppConfig):
name = "substrapp"
Expand All @@ -18,3 +23,8 @@ def ready(self):
post_delete.connect(function_post_delete, sender=Function)
post_delete.connect(datamanager_post_delete, sender=DataManager)
post_delete.connect(model_post_delete, sender=Model)

if settings.TASK["PRIVATE_CA_ENABLED"]:
kubernetes.config.load_incluster_config()
k8s_client = kubernetes.client.CoreV1Api()
create_replace_private_ca_secret(k8s_client)
Loading