// This is also fine! We'll try the manual token creation process.
case*disco.ErrVersionNotSupported:
diags=diags.Append(tfdiags.Sourceless(
tfdiags.Warning,
"Host does not support Terraform login",
fmt.Sprintf("The given hostname %q allows creating Terraform authorization tokens, but requires a newer version of Terraform CLI to do so.",dispHostname),
))
default:
diags=diags.Append(tfdiags.Sourceless(
tfdiags.Warning,
"Host does not support Terraform login",
fmt.Sprintf("The given hostname %q cannot support \"terraform login\": %s.",dispHostname,err),
))
}
// If login service is unavailable, check for a TFE v2 API as fallback
varservice*url.URL
ifclientConfig==nil{
service,err=host.ServiceURL("tfe.v2")
// Ok! Are we speaking to Terraform Cloud/Enterprise? If so we'll try Terraform Cloud/Enterprise's
fmt.Sprintf("The given hostname %q cannot support \"terraform login\": %s.",dispHostname,err),
))
}
case*disco.ErrVersionNotSupported:
diags=diags.Append(tfdiags.Sourceless(
tfdiags.Warning,
"Host does not support Terraform login",
fmt.Sprintf("The given hostname %q allows creating Terraform authorization tokens, but requires a newer version of Terraform CLI to do so.",dispHostname),
))
default:
diags=diags.Append(tfdiags.Sourceless(
tfdiags.Warning,
"Host does not support Terraform login",
fmt.Sprintf("The given hostname %q cannot support \"terraform login\": %s.",dispHostname,err),