Skip to content

Commit 6a16ac1

Browse files
committed
fix: return the original secret if unresolvable
1 parent 22a19b5 commit 6a16ac1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/phase/utils/secret_referencing.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ def resolve_secret_reference(ref: str, secrets_dict: Dict[str, Dict[str, Dict[st
9797
Returns:
9898
str: The resolved secret value or the original reference if not resolved.
9999
"""
100-
app_name = current_application_name
100+
original_ref = ref # Store the original reference
101+
app_name = current_application_name
101102
env_name = current_env_name
102103
path = "/" # Default root path
103104
key_name = ref
@@ -134,8 +135,8 @@ def resolve_secret_reference(ref: str, secrets_dict: Dict[str, Dict[str, Dict[st
134135
except EnvironmentNotFoundException:
135136
pass
136137

137-
# Return the reference as is if not resolved
138-
return f"${{{ref}}}"
138+
# Return the original secret value as is if not resolved
139+
return f"${{{original_ref}}}"
139140

140141

141142
def resolve_all_secrets(value: str, all_secrets: List[Dict[str, str]], phase: 'Phase', current_application_name: str, current_env_name: str) -> str:

0 commit comments

Comments
 (0)