Skip to content

Add logging for error cases while building the node image #72

@shivamsamarth

Description

@shivamsamarth

Building the node image doesn't log for the error conditions and it simply stops without providing any information regarding the actual error.
For example, if we build with incorrect HOST_IP parameter:

$ make build-node-image KUBERNETES_VERSION=v1.26.5+vmware.2-fips.1 OS_TARGET=photon-3 TKR_SUFFIX=byoi IMAGE_ARTIFACTS_PATH=$HOME/images HOST_IP=1.2.3.4
sha256:d64a60cc9a0937d1e03796809e3386aaff2ef2bc26b1f978c1f61a3edb49a4a9
Using default port for artifacts container 8081
Using default Packer HTTP port 8082
v1.26.5---vmware.2-fips.1-photon-3-image-builder
620dce058b414f31f7820c215d7cbfaf2cd5049eaf2b59533d4018ca656ba7ed

 Hint: Use "docker logs -f v1.26.5---vmware.2-fips.1-photon-3-image-builder" to see logs and status
 Hint: Node Image OVA can be found at /root/images/ovas

The docker logs only contain the following messages:

$ docker logs -f v1.26.5---vmware.2-fips.1-photon-3-image-builder
+ image_builder_root=/image-builder/images/capi
+ default_packer_variables=/image-builder/images/capi/image/packer-variables/
+ packer_configuration_folder=/image-builder/images/capi
+ tkr_metadata_folder=/image-builder/images/capi/tkr-metadata/
+ custom_ovf_properties_file=/image-builder/images/capi/custom_ovf_properties.json
+ artifacts_output_folder=/image-builder/images/capi/artifacts
+ ova_destination_folder=/image-builder/images/capi/artifacts/ovas
+ photon3_stig_compliance=false
+ main
+ copy_custom_image_builder_files
+ cp image/hack/tkgs-image-build-ova.py hack/image-build-ova.py
+ cp image/hack/tkgs_ovf_template.xml hack/ovf_template.xml
+ download_configuration_files
+ wget -q http://1.2.3.4:8081/artifacts/metadata/kubernetes_config.json

From the above logs, it is not evident why the build did not generate any OVA.
The ask is to provide relevant error log messages for any failures reported in build-ova.sh.

In addition to above, there is a minor request to update the Readme with the HOST_IP parameter description which is available in the make help command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions