Task/csi 3503 add verification scrips only#226
Conversation
Signed-off-by: matancarmeli7 <matan.carmeli7@gmail.com>
Signed-off-by: matancarmeli7 <matan.carmeli7@gmail.com>
Signed-off-by: matancarmeli7 <matan.carmeli7@gmail.com>
Signed-off-by: matancarmeli7 <matan.carmeli7@gmail.com>
Signed-off-by: matancarmeli7 <matan.carmeli7@gmail.com>
Signed-off-by: matancarmeli7 <matan.carmeli7@gmail.com>
|
|
||
| get_csv_files (){ | ||
| current_csi_version=$(get_current_csi_version) | ||
| ls deploy/olm-catalog/*/$current_csi_version/manifests/ibm-block-csi-operator.v$current_csi_version.clusterserviceversion.yaml |
There was a problem hiding this comment.
I still see the wildcard.
what happens if there's only one bundle for the current csi version? I don't think the test should fail. it should test what it can, and allow separate additions
Signed-off-by: matancarmeli7 <matan.carmeli7@gmail.com>
|
|
||
| verify_yaml_doc_in_multidoc_yaml(){ | ||
| yamls_dictionary=${1#*=} | ||
| eval "declare -A yaml_kinds_by_origin_yaml_path="${yamls_dictionary} |
There was a problem hiding this comment.
https://stackoverflow.com/a/3467959
Avoid eval like the plague
There was a problem hiding this comment.
I tried without it and I didn't manage to find a solution, the variable pass between the functions interrupted it, you sent an example without a function
There was a problem hiding this comment.
| [$roles_yaml_path]="ClusterRole" | ||
| [$crd_yaml_path]="CustomResourceDefinition" | ||
| ["config/rbac/service_account.yaml"]="ServiceAccount" | ||
| ["config/rbac/role_binding.yaml"]="ClusterRoleBinding" | ||
| ["config/manager/manager.yaml"]="Deployment" |
There was a problem hiding this comment.
why do we need the kinds hardcoded? can't we find them dynamically?
There was a problem hiding this comment.
I will open a ticket
There was a problem hiding this comment.
to add resource_type=$(yq e .kind $original_yaml)?
|
|
||
| verify_no_crds_diff (){ | ||
| echo "check crds alignment" | ||
| are_manifest_files_exist_in_current_csi_version |
| ls deploy/olm-catalog/ibm-block-csi-operator-community/$current_csi_version/manifests/ibm-block-csi-operator.v$current_csi_version.clusterserviceversion.yaml | ||
| ls deploy/olm-catalog/ibm-block-csi-operator/$current_csi_version/manifests/ibm-block-csi-operator.clusterserviceversion.yaml |
There was a problem hiding this comment.
consider moving the olm-catalog path to a common "const"
| check_generation (){ | ||
| echo "check generation" | ||
| project_dirname=ibm-block-csi-operator | ||
| cd .. | ||
| cp -r $project_dirname ./$project_dirname-expected | ||
| cd $project_dirname-expected/ | ||
| make update | ||
| cd .. | ||
| diff -qr --exclude=bin $project_dirname $project_dirname-expected/ | ||
| rm -rf $project_dirname-expected/ | ||
| cd $project_dirname | ||
| } |
There was a problem hiding this comment.
| check_generation (){ | |
| echo "check generation" | |
| project_dirname=ibm-block-csi-operator | |
| cd .. | |
| cp -r $project_dirname ./$project_dirname-expected | |
| cd $project_dirname-expected/ | |
| make update | |
| cd .. | |
| diff -qr --exclude=bin $project_dirname $project_dirname-expected/ | |
| rm -rf $project_dirname-expected/ | |
| cd $project_dirname | |
| } | |
| check_generation ()( | |
| echo "check generation" | |
| project_path=$PWD | |
| cp -r $project_path $project_path-expected | |
| cd $project_path-expected | |
| make update | |
| diff -qr --exclude=bin $project_path $project_path-expected/ | |
| cd .. | |
| rm -rf $project_path-expected/ | |
| ) |
would this work? less cd (+ absolute paths are more accurate + no hardcoded project name)
Signed-off-by: matancarmeli7 matan.carmeli7@gmail.com