kubernetes-sigs / image-builder

Tools for building Kubernetes disk images
https://image-builder.sigs.k8s.io/
Apache License 2.0
396 stars 394 forks source link

Ensure functions don't check for the correct version of binaries #374

Open jsturtevant opened 4 years ago

jsturtevant commented 4 years ago

Received an error during building the an image. The ensure-ansible checks for Ansible to be installed but doesn't check the minimum version like the ensure-goss.sh script does. The output had Right version of binary present so I didn't initially notice that I had an older version of Packer:

make build-azure-vhd-ubuntu-1804                     
hack/ensure-ansible.sh  
hack/ensure-packer.sh                                                                                                                    
hack/ensure-jq.sh                                                                                                                        
hack/ensure-azure-cli.sh                                                                                                                 
hack/ensure-goss.sh                                                                                                                      
Right version of binary present                                                                                                         
 ./image-builder/images/capi/packer/azure/scripts/init-vhd.sh && packer build -var-file="/image-builder/images/capi/packer/config/kubernetes.json"  -var-file="/image-builder/images/capi/packer/config/cni.json"  -var-file="/image-builder/images/capi/packer/config/containerd.json"  -var-file="/image-builder/images/capi/packer/config/ansible-args.json"  -var-file="/image-builder/images/capi/packer/config/goss-args.json"  -var-file="/image-builder/images/capi/packer/config/common.json"  -color=true -var-file="/image-builder/images/capi/packer/azure/azure-config.json" -var-file="/image-builder/images/capi/packer/azure/azure-vhd.json" -var-file="/image-builder/images/capi/packer/azure/ubuntu-1804.json" -only="vhd-ubuntu-1804"  packer/azure/packer.json 

<snip>

Error initializing core: error interpolating default value for 'containerd_url': template: root:1:71: executing "root" at <user `containerd_ver...>: error calling user: test                                                                                                     
make: *** [Makefile:254: build-azure-vhd-ubuntu-1804] Error 1

After upgrading to 1.6 this error went away.

Reproduce

# install older version of package
sudo apt install packer=1.3.4+dfsg-4 -V
# build an image
make build-azure-vhd-ubuntu-1804    

Other info

The ensure scripts haver versions in them. Is there a minimum of each tool or should there be a hard check for the versions that are in the ensure scripts?

fejta-bot commented 3 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

detiber commented 3 years ago

/lifecycle frozen