Skip to content

Task/csi 3503 add verification scrips only#226

Draft
matancarmeli7 wants to merge 9 commits into
developfrom
task/CSI-3503_add_verification_scripts
Draft

Task/csi 3503 add verification scrips only#226
matancarmeli7 wants to merge 9 commits into
developfrom
task/CSI-3503_add_verification_scripts

Conversation

@matancarmeli7

Copy link
Copy Markdown
Contributor

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>
Comment thread hack/get_information_helper.sh
Signed-off-by: matancarmeli7 <matan.carmeli7@gmail.com>
Comment thread hack/check-files-alignment.sh Outdated
Comment thread hack/check-files-alignment.sh Outdated
Signed-off-by: matancarmeli7 <matan.carmeli7@gmail.com>
Comment thread hack/check-files-alignment.sh
@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
Comment thread hack/project_info.sh Outdated
Comment thread hack/project_info.sh Outdated
Comment thread 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread hack/project_info.sh Outdated
ArbelNathan
ArbelNathan previously approved these changes Dec 21, 2021

@ArbelNathan ArbelNathan left a comment

Copy link
Copy Markdown
Contributor

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 <matan.carmeli7@gmail.com>

verify_yaml_doc_in_multidoc_yaml(){
yamls_dictionary=${1#*=}
eval "declare -A yaml_kinds_by_origin_yaml_path="${yamls_dictionary}

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

Choose a reason for hiding this comment

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

code dup

Comment thread hack/project_info.sh
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

@oriyarde oriyarde Dec 22, 2021

Copy link
Copy Markdown
Contributor

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
}

@oriyarde oriyarde Dec 22, 2021

Copy link
Copy Markdown
Contributor

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