openshift-metal3 / dev-scripts

Scripts to automate development/test setup for openshift integration with https://github.com/metal3-io/
Apache License 2.0
91 stars 177 forks source link

Wrong command in ./01_install_requirements.sh script #1620

Open mnietoji opened 6 months ago

mnietoji commented 6 months ago

+(./01_install_requirements.sh:102): yq -iy '.[3].dnf.nobest = "true"' /home/dev-scripts/metal3-dev-env/vm-setup/roles/packages_installation/tasks/centos_required_packages.yml Error: unknown shorthand flag: 'y' in -y Usage: yq eval [expression] [yaml_file1]... [flags]

This line is wrong yq -iy '.[3].dnf.nobest = "true"' ${METAL3_DEV_ENV_PATH}/vm-setup/roles/packages_installation/tasks/centos_required_packages.yml

mnietoji commented 6 months ago

yq --version yq (https://github.com/mikefarah/yq/) version v4.40.5

mnietoji commented 6 months ago

I have seen that yq -iy works with yq 3.2.3 but fails with yq 4.40.5, but i think v4 is being installed here: dev-scripts/metallb/deploy_operator.sh:go install -mod='' github.com/mikefarah/yq/v4@v4.13.3

bdlink commented 3 weeks ago

yq v3 has not been supported since 2021, need to check all places yq is used and make sure they work for yq v4.18.1 and later versions.

bdlink commented 2 weeks ago

Issue here seems to be that yq 3.4.3 (which is installed by the script) is not installed if another version is already present. removing the offending option -y does not work, because later uses of yq will fail (as incompatable with yq v4).

elfosardo commented 2 weeks ago

just left a comment in the related PR: I beleive the latest available version in pypi is still 3.x I'd rather pin yq version installed so when the new version comes out we don't break dev-scripts

elfosardo commented 2 weeks ago

this should help https://github.com/openshift-metal3/dev-scripts/pull/1668 when 4.x is available on pypi we can think about updating the command