@@ -21,15 +21,16 @@ SBOM_FILE="${ROOT}/docs/sbom.json"
21
21
SBOM_TEMPLATE_FILE=" ${ROOT} /docs/sbom.template.json"
22
22
23
23
# TODO: setting config path here to be able to source common.bash
24
- tmp_config_path=$( mktemp -d --suffix -config-path)
24
+ tmp_config_path=$( mktemp -d --suffix -sbom- config-path)
25
25
export CK8S_CONFIG_PATH=" ${tmp_config_path} "
26
26
27
27
# shellcheck source=bin/common.bash
28
28
source " ${ROOT} /bin/common.bash"
29
+ append_trap " rm -rf ${tmp_config_path} >/dev/null 2>&1" EXIT
29
30
# TODO: sources test scripts to set up new Welkin config, this could be generalized to not rely on test path
30
31
source " ${ROOT} /tests/common/bats/env.bash"
32
+ source " ${ROOT} /tests/common/bats/gpg.bash"
31
33
source " ${ROOT} /tests/common/bats/yq.bash"
32
- append_trap " rm -rf ${tmp_config_path} >/dev/null 2>&1" EXIT
33
34
34
35
usage () {
35
36
echo " COMMANDS:" >&2
@@ -47,10 +48,12 @@ usage() {
47
48
exit 1
48
49
}
49
50
50
- # TODO: currently requires CK8S_PGP_FP to be set, look into creating temp key similar to bats tests?
51
51
init_welkin_config () {
52
+ log_info " Initializing Welkin config used for generating Welkin"
52
53
export PATH=" ${ROOT} /bin:${PATH} "
53
- env.setup
54
+ gpg.setup_one > /dev/null 2>&1
55
+ # append_trap "gpg.teardown" EXIT
56
+ env.setup > /dev/null 2>&1
54
57
env.init " ${@ } "
55
58
}
56
59
@@ -395,7 +398,7 @@ _generate_helmfile_template_file() {
395
398
396
399
# adds container images for a specific resource type and chart release based on its location to a input sbom file
397
400
_add_container_images_from_template () {
398
- local location sbom_file template_file chart_name type query
401
+ local chart_location chart_name chart_version location sbom_file template_file query
399
402
sbom_file=" ${1} "
400
403
template_file=" ${2} "
401
404
chart=" ${3} "
@@ -454,7 +457,7 @@ _add_container_images_for_component() {
454
457
455
458
# loops over all charts included in the sbom and adds templated container images to a input sbom file
456
459
_add_container_images () {
457
- local sbom_file
460
+ local chart sbom_file template_file
458
461
if [[ " $# " -lt 1 ]] || [[ " $# " -gt 2 ]]; then
459
462
log_fatal " usage: _add_container_images <sbom-file>"
460
463
fi
0 commit comments