Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Yaroslav Borbat <[email protected]>
  • Loading branch information
yaroslavborbat committed Mar 5, 2024
1 parent e4d4a46 commit 296baef
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion hooks/generate_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def main():
f"virtualization-api.{common.NAMESPACE}",
f"virtualization-api.{common.NAMESPACE}.svc"],
),
tls_secret_name="virtualziation-api-tls",
tls_secret_name="virtualization-api-tls",
values_path_prefix=f"{common.MODULE_NAME}.internal.apiserver.cert"
),

Expand Down
10 changes: 7 additions & 3 deletions hooks/lib/certificate/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ def parse_key(key: str) -> crypto.PKey:


def get_certificate_san(crt: crypto.X509) -> list[str]:
san = ''
san = ""
ext_count = crt.get_extension_count()
for i in range(0, ext_count):
ext = crt.get_extension(i)
if 'subjectAltName' in str(ext.get_short_name()):
if "subjectAltName"in str(ext.get_short_name()):
san = ext.__str__()
return san.split(', ')
break
if len(san) > 0:
return san.split(', ')
return []



def is_outdated_ca(ca: str, cert_outdated_duration: timedelta) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion templates/virtualization-api/cert-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: Secret
metadata:
name: virtualziation-api-tls
name: virtualization-api-tls
namespace: d8-{{ .Chart.Name }}
{{- include "helm_lib_module_labels" (list . (dict "app" "virtualization-api")) | nindent 2 }}
type: kubernetes.io/tls
Expand Down
6 changes: 3 additions & 3 deletions templates/virtualization-api/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ spec:
imagePullPolicy: Always
volumeMounts:
- mountPath: /etc/virtualziation-api/certificates
name: virtualziation-api-tls
name: virtualization-api-tls
readOnly: true
- mountPath: /etc/virtualziation-api-proxy/certificates
name: virtualziation-api-proxy-tls
Expand All @@ -98,11 +98,11 @@ spec:
{{- include "helm_lib_node_selector" (tuple . "master") | nindent 6 }}
{{- include "helm_lib_tolerations" (tuple . "any-node") | nindent 6 }}
volumes:
- name: virtualziation-api-tls
- name: virtualization-api-tls
secret:
defaultMode: 420
optional: true
secretName: virtualziation-api-tls
secretName: virtualization-api-tls
- name: kubevirt-virt-api-certs
secret:
defaultMode: 420
Expand Down

0 comments on commit 296baef

Please sign in to comment.