File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ case "${1}" in
139139 validate)
140140 [[ " ${2} " =~ ^(wc| sc)$ ]] || usage
141141 check_tools
142- config_load " $2 "
142+ config_load " $2 " " ${3 :- config} "
143143 echo " Config validation successful"
144144 ;;
145145 providers) echo " ${ck8s_cloud_providers[@]} " ;;
Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ validate_config() {
393393 " ${config_template_path} /config/sc-config.yaml" \
394394 > " ${template_file} "
395395 validate " ${config[config_file_sc]} " " ${template_file} "
396- schema_validate " ${config[config_file_sc]} " " ${config_template_path} /schemas/config.yaml"
396+ schema_validate " ${config[config_file_sc]} " " ${config_template_path} /schemas/${2 :- config} .yaml"
397397 validate " ${secrets[secrets_file]} " " ${config_template_path} /secrets/sc-secrets.yaml"
398398 schema_validate " ${secrets[secrets_file]} " " ${config_template_path} /schemas/secrets.yaml"
399399 elif [[ $1 == " wc" ]]; then
@@ -404,11 +404,11 @@ validate_config() {
404404 " ${config_template_path} /config/wc-config.yaml" \
405405 > " ${template_file} "
406406 validate " ${config[config_file_wc]} " " ${template_file} "
407- schema_validate " ${config[config_file_wc]} " " ${config_template_path} /schemas/config.yaml"
407+ schema_validate " ${config[config_file_wc]} " " ${config_template_path} /schemas/${2 :- config} .yaml"
408408 validate " ${secrets[secrets_file]} " " ${config_template_path} /secrets/wc-secrets.yaml"
409409 schema_validate " ${secrets[secrets_file]} " " ${config_template_path} /schemas/secrets.yaml"
410410 else
411- log_error " ERROR: usage validate_config <sc|wc>"
411+ log_error " ERROR: usage validate_config <sc|wc> [section] "
412412 exit 1
413413 fi
414414}
@@ -451,7 +451,7 @@ config_load() {
451451
452452 if [[ " --skip-validation" != " ${2:- ' ' } " ]]; then
453453 validate_version " $1 "
454- validate_config " $1 "
454+ validate_config " $1 " " $2 "
455455 validate_sops_config
456456 fi
457457}
You can’t perform that action at this time.
0 commit comments