Skip to content
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

Draft
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

matancarmeli7
Copy link
Contributor

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]>
@oriyarde oriyarde closed this Dec 6, 2021
@oriyarde oriyarde deleted the task/CSI-3503_add_verification_scripts branch December 6, 2021 14:39
@oriyarde oriyarde restored the task/CSI-3503_add_verification_scripts branch December 6, 2021 15:16
@matancarmeli7 matancarmeli7 reopened this Dec 6, 2021
hack/project_info.sh Outdated Show resolved Hide resolved
hack/project_info.sh Outdated Show resolved Hide resolved

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

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

hack/project_info.sh Outdated Show resolved Hide resolved
ArbelNathan
ArbelNathan previously approved these changes Dec 21, 2021
Copy link
Contributor

@ArbelNathan ArbelNathan left a 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}
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +48 to +52
[$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"
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code dup

Comment on lines +35 to +36
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
Copy link
Contributor

@oriyarde oriyarde Dec 22, 2021

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"

Comment on lines +23 to +34
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
}
Copy link
Contributor

@oriyarde oriyarde Dec 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants