Skip to content

Commit

Permalink
[DPE-5015] Encode keys before keeping them in K8s secrets (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
theoctober19th authored Aug 5, 2024
1 parent f45244c commit 1c488eb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion files/scripts/monitor_sa.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

from spark8t.literals import HUB_LABEL
from spark8t.domain import PropertyFile
from spark8t.utils import PercentEncodingSerializer

logger = logging.getLogger(__name__)
logging.basicConfig(
Expand Down Expand Up @@ -63,7 +64,10 @@ def read_configuration_file(file_path: str) -> Optional[Dict[str, str]]:
logger.info(f"Service account: {sa_name} --- namespace: {namespace}")
# skip in case of deletion or operation that do not need secret update.
logger.info(f"Config file: {args.config}")
options = read_configuration_file(args.config)
options = {
PercentEncodingSerializer().serialize(key): value
for key, value in read_configuration_file(args.config).items()
}
if options:
logger.info(f"Number of options: {len(options)}")
else:
Expand Down

0 comments on commit 1c488eb

Please sign in to comment.