Issue #3077828 by Xiaohua Guan: Fix an Internal Server Error when saving a Cloud Service Provider for k8s if the API endpoint cannot be connected