Skip to content

Commit

Permalink
Skip if no enabled version (#33708)
Browse files Browse the repository at this point in the history
  • Loading branch information
bnchrch committed Dec 21, 2023
1 parent 1d76fd2 commit 08c2da2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ def __load_gsm_secrets(self) -> List[RemoteSecret]:
enabled_versions = [version["name"] for version in versions_data["versions"] if version["state"] == "ENABLED"]
if len(enabled_versions) > 1:
self.logger.critical(f"{log_name} should have one enabled version at the same time!!!")
if not enabled_versions:
self.logger.warning(f"{log_name} doesn't have enabled versions for {secret_name}")
continue
enabled_version = enabled_versions[0]
secret_url = f"https://secretmanager.googleapis.com/v1/{enabled_version}:access"
secret_data = self.api.get(secret_url)
Expand Down

0 comments on commit 08c2da2

Please sign in to comment.