-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task/csi 3503 add verification scrips only #226
base: develop
Are you sure you want to change the base?
Conversation
Signed-off-by: matancarmeli7 <[email protected]>
Signed-off-by: matancarmeli7 <[email protected]>
Signed-off-by: matancarmeli7 <[email protected]>
Signed-off-by: matancarmeli7 <[email protected]>
Signed-off-by: matancarmeli7 <[email protected]>
Signed-off-by: matancarmeli7 <[email protected]>
hack/project_info.sh
Outdated
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please avoid wildcards
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: matancarmeli7 <[email protected]>
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://stackoverflow.com/a/3467959
Avoid eval like the plague
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[$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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need the kinds hardcoded? can't we find them dynamically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will open a ticket
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code dup
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 [email protected]