<commit_before>#!/bin/bash
: "${taito_cli_path:?}"
: "${taito_plugin_path:?}"
: "${taito_namespace:?}"

flag=${1}

"${taito_cli_path}/plugins/kubectl/util/use-context.sh" && \

# shellcheck disable=SC1090
. "${taito_plugin_path}/util/get-secrets.sh" && \

# Print secret values
echo 'Showing secrets from Kubernetes:' && \
echo && \
rm taito-secrets.sh &> /dev/null || : && \
secret_index=0 && \
secret_names=(${taito_secret_names}) && \
for secret_name in "${secret_names[@]}"
do
  . "${taito_cli_path}/util/secret-by-index.sh" && \

  if [[ ${secret_method} != "copy/"* ]] && [[ ${secret_method} != "read/"* ]]; then
    if [[ "${flag}" == "--save-as-taito-secrets" ]]; then
      echo "export ${secret_value_var}=\"${secret_value}\"; " >> taito-secrets.sh
    else
      echo "Secret ${secret_name}:"
      echo "${secret_value}"
      echo<commit_msg>feat(kube-secrets): show secret list on 'taito secrets'<commit_after>#!/bin/bash
: "${taito_cli_path:?}"
: "${taito_plugin_path:?}"
: "${taito_namespace:?}"

flag=${1}

"${taito_cli_path}/plugins/kubectl/util/use-context.sh" && \

kubectl get secrets && \
echo && \

# shellcheck disable=SC1090
. "${taito_plugin_path}/util/get-secrets.sh" && \

# Print secret values
echo 'Showing secret values from Kubernetes:' && \
echo && \
rm taito-secrets.sh &> /dev/null || : && \
secret_index=0 && \
secret_names=(${taito_secret_names}) && \
for secret_name in "${secret_names[@]}"
do
  . "${taito_cli_path}/util/secret-by-index.sh" && \

  if [[ ${secret_method} != "copy/"* ]] && [[ ${secret_method} != "read/"* ]]; then
    if [[ "${flag}" == "--save-as-taito-secrets" ]]; then
      echo "export ${secret_value_var}=\"${secret_value}\"; " >> taito-secrets.sh
    else
      echo "Secret ${secret_name}:"
      echo "${secret_value}"
      echo
{'fraction_non_alphanumeric': 0.22742474916387959, 'fraction_numerical': 0.006688963210702341, 'mean_word_length': 3.986111111111111, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4017138', 'n_tokens_mistral': 714, 'n_tokens_neox': 675, 'n_words': 110}