Make server backup schedule resources beta (#434)
* Make server backup schedule resources beta * Adjust guide
This commit is contained in:
parent
b5eb8bd379
commit
5b617e0676
11 changed files with 86 additions and 22 deletions
|
|
@ -39,12 +39,12 @@ Defaulting to the provider feature flag.`, value)
|
|||
//
|
||||
// Should be called in the Configure method of a beta resource.
|
||||
// Then, check for Errors in the diags using the diags.HasError() method.
|
||||
func CheckBetaResourcesEnabled(ctx context.Context, data *core.ProviderData, diags *diag.Diagnostics, resourceName string) {
|
||||
func CheckBetaResourcesEnabled(ctx context.Context, data *core.ProviderData, diags *diag.Diagnostics, resourceName, resourceType string) {
|
||||
if !BetaResourcesEnabled(ctx, data, diags) {
|
||||
core.LogAndAddErrorBeta(ctx, diags, resourceName)
|
||||
core.LogAndAddErrorBeta(ctx, diags, resourceName, resourceType)
|
||||
return
|
||||
}
|
||||
core.LogAndAddWarningBeta(ctx, diags, resourceName)
|
||||
core.LogAndAddWarningBeta(ctx, diags, resourceName, resourceType)
|
||||
}
|
||||
|
||||
func AddBetaDescription(description string) string {
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ func TestCheckBetaResourcesEnabled(t *testing.T) {
|
|||
t.Setenv("STACKIT_TF_ENABLE_BETA_RESOURCES", envValue)
|
||||
|
||||
diags := diag.Diagnostics{}
|
||||
CheckBetaResourcesEnabled(context.Background(), &core.ProviderData{}, &diags, "test")
|
||||
CheckBetaResourcesEnabled(context.Background(), &core.ProviderData{}, &diags, "stackit_test", "resource")
|
||||
|
||||
if tt.expectError && diags.ErrorsCount() == 0 {
|
||||
t.Fatalf("Expected error, got none")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue