Fix envInjector to correctly handle non-Deployment inputs

This commit is contained in:
suyiiyii 2025-03-14 21:33:16 +08:00
parent 98e324c586
commit f3e247460a
Signed by: suyiiyii
GPG Key ID: 044704CB29B8AD85

View File

@ -21,7 +21,7 @@ envInjector = lambda envs: Envs, input: appsv1.Deployment | any {
"""Inject envs to Deployment""" """Inject envs to Deployment"""
_result: any = {} _result: any = {}
if input.kind != "Deployment": if input.kind != "Deployment":
input input = _result
else: else:
deploy: appsv1.Deployment = input as appsv1.Deployment deploy: appsv1.Deployment = input as appsv1.Deployment
secretEnv: [corev1.EnvVar] = [{ secretEnv: [corev1.EnvVar] = [{