Skip to content

Commit 50d74e6

Browse files
authored
Improve beta documentation (#414)
* replace BETA with beta * improve beta error text * remove reference to guide
1 parent a07ff3f commit 50d74e6

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

stackit/internal/core/core.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ func LogAndAddWarning(ctx context.Context, diags *diag.Diagnostics, summary, det
6969
}
7070

7171
func LogAndAddWarningBeta(ctx context.Context, diags *diag.Diagnostics, name string) {
72-
warnTitle := fmt.Sprintf("The resource %q is in BETA", name)
73-
warnContent := fmt.Sprintf("The resource %q is in BETA and may be subject to breaking changes in the future. Use with caution.", name)
72+
warnTitle := fmt.Sprintf("The resource %q is in beta", name)
73+
warnContent := fmt.Sprintf("The resource %q is in beta and may be subject to breaking changes in the future. Use with caution.", name)
7474
tflog.Warn(ctx, fmt.Sprintf("%s | %s", warnTitle, warnContent))
7575
diags.AddWarning(warnTitle, warnContent)
7676
}
7777

7878
func LogAndAddErrorBeta(ctx context.Context, diags *diag.Diagnostics, name string) {
79-
errTitle := fmt.Sprintf("The resource %q is in BETA and BETA is not enabled", name)
80-
errContent := fmt.Sprintf("The resource %q is in BETA and the BETA functionality is currently not enabled. Please refer to the documentation on how to enable the BETA functionality.", name)
79+
errTitle := fmt.Sprintf("The resource %q is in beta and beta is not enabled", name)
80+
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)
8181
tflog.Error(ctx, fmt.Sprintf("%s | %s", errTitle, errContent))
8282
diags.AddError(errTitle, errContent)
8383
}

stackit/internal/features/beta.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
1111
)
1212

13-
// BetaResourcesEnabled returns whether this provider has BETA functionality enabled.
13+
// BetaResourcesEnabled returns whether this provider has beta functionality enabled.
1414
//
1515
// In order of precedence, beta functionality can be managed by:
1616
// - Environment Variable `STACKIT_TF_ENABLE_BETA_RESOURCES` - `true` is enabled, `false` is disabled.
@@ -24,7 +24,7 @@ func BetaResourcesEnabled(ctx context.Context, data *core.ProviderData, diags *d
2424
if strings.EqualFold(value, "false") {
2525
return false
2626
}
27-
warnDetails := fmt.Sprintf(`The value of the environment variable that enables BETA functionality must be either "true" or "false", got %q.
27+
warnDetails := fmt.Sprintf(`The value of the environment variable that enables beta functionality must be either "true" or "false", got %q.
2828
Defaulting to the provider feature flag.`, value)
2929
core.LogAndAddWarning(ctx, diags, "Invalid value for STACKIT_TF_ENABLE_BETA_RESOURCES environment variable.", warnDetails)
3030
}
@@ -35,9 +35,9 @@ Defaulting to the provider feature flag.`, value)
3535
return data.EnableBetaResources
3636
}
3737

38-
// CheckBetaResourcesEnabled is a helper function to log and add a warning or error if the BETA functionality is not enabled.
38+
// CheckBetaResourcesEnabled is a helper function to log and add a warning or error if the beta functionality is not enabled.
3939
//
40-
// Should be called in the Configure method of a BETA resource.
40+
// Should be called in the Configure method of a beta resource.
4141
// Then, check for Errors in the diags using the diags.HasError() method.
4242
func CheckBetaResourcesEnabled(ctx context.Context, data *core.ProviderData, diags *diag.Diagnostics, resourceName string) {
4343
if !BetaResourcesEnabled(ctx, data, diags) {

0 commit comments

Comments
 (0)