From 849472c02cc608e96a30e57d1498007d3a88fe16 Mon Sep 17 00:00:00 2001 From: Masaru Hoshi Date: Fri, 4 Feb 2022 11:23:32 -0500 Subject: [PATCH] python syntax fix + remove port override in mutatewebhook --- connaisseur/flask_application.py | 10 ++++++++-- helm/templates/certificate_webhook-conf.yaml | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/connaisseur/flask_application.py b/connaisseur/flask_application.py index 738782578..b901519fd 100644 --- a/connaisseur/flask_application.py +++ b/connaisseur/flask_application.py @@ -51,8 +51,14 @@ def handle_alert_config_error(err): @APP.route("/mutate", methods=["POST"]) -@metrics.counter('mutate_requests_total', 'Total number of mutate requests',labels={'allowed': lambda r: r.get_json(silent=True)['response']['allowed'], - 'status_code': lambda r: r.get_json(silent=True)['response']['status']['code']}) +@metrics.counter( + "mutate_requests_total", + "Total number of mutate requests", + labels={ + "allowed": lambda r: r.get_json(silent=True)["response"]["allowed"], + "status_code": lambda r: r.get_json(silent=True)["response"]["status"]["code"], + }, +) def mutate(): """ Handle the '/mutate' path and accept CREATE and UPDATE requests. diff --git a/helm/templates/certificate_webhook-conf.yaml b/helm/templates/certificate_webhook-conf.yaml index db7ef01e7..8f5635f8d 100644 --- a/helm/templates/certificate_webhook-conf.yaml +++ b/helm/templates/certificate_webhook-conf.yaml @@ -71,7 +71,6 @@ webhooks: name: {{ .Chart.Name }}-svc namespace: {{ .Release.Namespace }} path: /mutate - port: {{ .Values.service.port }} caBundle: {{ default ($certs.Cert | b64enc) (include "getInstalledTLSCert" .) }} rules: - operations: ["CREATE", "UPDATE"]