tanzu management-cluster" or "tanzu mc" get or update commands, users see errors like:Error: unable to ensure prerequisites: unable to ensure tkg BOM file: failed to initialize the BOM registry to download default bom files : failed to initialze registry client: Adding CA certificates from '/root/registry_certs': failedTKG_CUSTOM_IMAGE_REPOSITORY_CA_CERTIFICATE environment variable has been added according to the Install Harbor Image Registry section of the TKG Air-Gapped Environment deployment steps.This error is caused by an incorrectly configured or encoded TKG_CUSTOM_IMAGE_REPOSITORY_CA_CERTIFICATE environmental variable in TKG Air-Gapped environments.
Review the TKG_CUSTOM_IMAGE_REPOSITORY_CA_CERTIFICATE value configured on the TKGm jumpbox VM to ensure it is configured in a valid format:
env | grep TKGTKG_CUSTOM_IMAGE_REPOSITORY_CA_CERTIFICATE= and use base64 to decode it:echo <ENCODED_STRING_FROM_STEP_1> | base64 -decho <ENCODED_STRING_FROM_STEP_1> | base64 -d | openssl x509 -noout -text
Ensure the certificate has starts with -----BEGIN CERTIFICATE----- and ends with -----END CERTIFICATE-----. There should be 5 hyphens before and after each entry with no spaces and the cert hash pasted in between.