Make server backup schedule resources beta (#434)

* Make server backup schedule resources beta

* Adjust guide
This commit is contained in:
João Palet 2024-06-26 14:02:50 +01:00 committed by GitHub
parent b5eb8bd379
commit 5b617e0676
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 86 additions and 22 deletions

View file

@ -69,16 +69,16 @@ func LogAndAddWarning(ctx context.Context, diags *diag.Diagnostics, summary, det
diags.AddWarning(summary, detail)
}
func LogAndAddWarningBeta(ctx context.Context, diags *diag.Diagnostics, name string) {
warnTitle := fmt.Sprintf("The resource %q is in beta", name)
warnContent := fmt.Sprintf("The resource %q is in beta and may be subject to breaking changes in the future. Use with caution.", name)
func LogAndAddWarningBeta(ctx context.Context, diags *diag.Diagnostics, name, resourceType string) {
warnTitle := fmt.Sprintf("The %s %q is in beta", resourceType, name)
warnContent := fmt.Sprintf("The %s %q is in beta and may be subject to breaking changes in the future. Use with caution.", resourceType, name)
tflog.Warn(ctx, fmt.Sprintf("%s | %s", warnTitle, warnContent))
diags.AddWarning(warnTitle, warnContent)
}
func LogAndAddErrorBeta(ctx context.Context, diags *diag.Diagnostics, name string) {
errTitle := fmt.Sprintf("The resource %q is in beta and beta is not enabled", name)
errContent := fmt.Sprintf(`The resource %q is in beta and the beta functionality is currently not enabled. To enable it, set the environment variable STACKIT_TF_ENABLE_BETA_RESOURCES to "true" or set the "enable_beta_resources" provider field to true.`, name)
func LogAndAddErrorBeta(ctx context.Context, diags *diag.Diagnostics, name, resourceType string) {
errTitle := fmt.Sprintf("The %s %q is in beta and beta is not enabled", resourceType, name)
errContent := fmt.Sprintf(`The %s %q is in beta and the beta functionality is currently not enabled. To enable it, set the environment variable STACKIT_TF_ENABLE_BETA_RESOURCES to "true" or set the "enable_beta_resources" provider field to true.`, resourceType, name)
tflog.Error(ctx, fmt.Sprintf("%s | %s", errTitle, errContent))
diags.AddError(errTitle, errContent)
}