diff --git a/pkg/apis/aws/helper/scheme.go b/pkg/apis/aws/helper/scheme.go index d86a82c62..b89ea50af 100644 --- a/pkg/apis/aws/helper/scheme.go +++ b/pkg/apis/aws/helper/scheme.go @@ -36,9 +36,13 @@ func init() { func CloudProfileConfigFromCluster(cluster *controller.Cluster) (*api.CloudProfileConfig, error) { var cloudProfileConfig *api.CloudProfileConfig if cluster != nil && cluster.CloudProfile != nil && cluster.CloudProfile.Spec.ProviderConfig != nil && cluster.CloudProfile.Spec.ProviderConfig.Raw != nil { + cloudProfileName := fmt.Sprintf("cloudProfile '%q'", client.ObjectKeyFromObject(cluster.CloudProfile)) + if cluster.Shoot != nil && cluster.Shoot.Spec.CloudProfile != nil { + cloudProfileName = fmt.Sprintf("%s '%s/%s'", cluster.Shoot.Spec.CloudProfile.Kind, cluster.Shoot.Namespace, cluster.Shoot.Spec.CloudProfile.Name) + } cloudProfileConfig = &api.CloudProfileConfig{} if _, _, err := decoder.Decode(cluster.CloudProfile.Spec.ProviderConfig.Raw, nil, cloudProfileConfig); err != nil { - return nil, fmt.Errorf("could not decode providerConfig of cloudProfile for '%s': %w", client.ObjectKeyFromObject(cluster.CloudProfile), err) + return nil, fmt.Errorf("could not decode providerConfig of %s: %w", cloudProfileName, err) } } return cloudProfileConfig, nil