Skip to content

Commit fadc859

Browse files
authored
Move server backup out of beta (#1266)
1 parent 285c7e3 commit fadc859

6 files changed

Lines changed: 3 additions & 49 deletions

File tree

docs/data-sources/server_backup_schedule.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ page_title: "stackit_server_backup_schedule Data Source - stackit"
44
subcategory: ""
55
description: |-
66
Server backup schedule datasource schema. Must have a region specified in the provider configuration.
7-
~> This datasource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
87
---
98

109
# stackit_server_backup_schedule (Data Source)
1110

1211
Server backup schedule datasource schema. Must have a `region` specified in the provider configuration.
1312

14-
~> This datasource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
15-
1613
## Example Usage
1714

1815
```terraform

docs/data-sources/server_backup_schedules.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ page_title: "stackit_server_backup_schedules Data Source - stackit"
44
subcategory: ""
55
description: |-
66
Server backup schedules datasource schema. Must have a region specified in the provider configuration.
7-
~> This datasource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
87
---
98

109
# stackit_server_backup_schedules (Data Source)
1110

1211
Server backup schedules datasource schema. Must have a `region` specified in the provider configuration.
1312

14-
~> This datasource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
15-
1613
## Example Usage
1714

1815
```terraform

docs/resources/server_backup_schedule.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ page_title: "stackit_server_backup_schedule Resource - stackit"
44
subcategory: ""
55
description: |-
66
Server backup schedule resource schema. Must have a region specified in the provider configuration.
7-
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
87
---
98

109
# stackit_server_backup_schedule (Resource)
1110

1211
Server backup schedule resource schema. Must have a `region` specified in the provider configuration.
1312

14-
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
15-
1613
## Example Usage
1714

1815
```terraform

stackit/internal/services/serverbackup/schedule/resource.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525

2626
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion"
2727
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
28-
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features"
2928
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils"
3029
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate"
3130

@@ -114,11 +113,6 @@ func (r *scheduleResource) Configure(ctx context.Context, req resource.Configure
114113
return
115114
}
116115

117-
features.CheckBetaResourcesEnabled(ctx, &r.providerData, &resp.Diagnostics, "stackit_server_backup_schedule", "resource")
118-
if resp.Diagnostics.HasError() {
119-
return
120-
}
121-
122116
apiClient := serverbackupUtils.ConfigureClient(ctx, &r.providerData, &resp.Diagnostics)
123117
if resp.Diagnostics.HasError() {
124118
return
@@ -130,8 +124,7 @@ func (r *scheduleResource) Configure(ctx context.Context, req resource.Configure
130124
// Schema defines the schema for the resource.
131125
func (r *scheduleResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
132126
resp.Schema = schema.Schema{
133-
Description: "Server backup schedule resource schema. Must have a `region` specified in the provider configuration.",
134-
MarkdownDescription: features.AddBetaDescription("Server backup schedule resource schema. Must have a `region` specified in the provider configuration.", core.Resource),
127+
Description: "Server backup schedule resource schema. Must have a `region` specified in the provider configuration.",
135128
Attributes: map[string]schema.Attribute{
136129
"id": schema.StringAttribute{
137130
Description: "Terraform's internal resource identifier. It is structured as \"`project_id`,`region`,`server_id`,`backup_schedule_id`\".",

stackit/internal/services/serverbackup/schedule/schedule_datasource.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,12 @@ import (
1616
"github.com/hashicorp/terraform-plugin-log/tflog"
1717

1818
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
19-
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features"
2019
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils"
2120
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate"
2221

2322
"github.com/stackitcloud/stackit-sdk-go/services/serverbackup"
2423
)
2524

26-
// scheduleDataSourceBetaCheckDone is used to prevent multiple checks for beta resources.
27-
// This is a workaround for the lack of a global state in the provider and
28-
// needs to exist because the Configure method is called twice.
29-
var scheduleDataSourceBetaCheckDone bool
30-
3125
// Ensure the implementation satisfies the expected interfaces.
3226
var (
3327
_ datasource.DataSource = &scheduleDataSource{}
@@ -57,14 +51,6 @@ func (r *scheduleDataSource) Configure(ctx context.Context, req datasource.Confi
5751
return
5852
}
5953

60-
if !scheduleDataSourceBetaCheckDone {
61-
features.CheckBetaResourcesEnabled(ctx, &r.providerData, &resp.Diagnostics, "stackit_server_backup_schedule", "data source")
62-
if resp.Diagnostics.HasError() {
63-
return
64-
}
65-
scheduleDataSourceBetaCheckDone = true
66-
}
67-
6854
apiClient := serverbackupUtils.ConfigureClient(ctx, &r.providerData, &resp.Diagnostics)
6955
if resp.Diagnostics.HasError() {
7056
return
@@ -76,8 +62,7 @@ func (r *scheduleDataSource) Configure(ctx context.Context, req datasource.Confi
7662
// Schema defines the schema for the data source.
7763
func (r *scheduleDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
7864
resp.Schema = schema.Schema{
79-
Description: "Server backup schedule datasource schema. Must have a `region` specified in the provider configuration.",
80-
MarkdownDescription: features.AddBetaDescription("Server backup schedule datasource schema. Must have a `region` specified in the provider configuration.", core.Datasource),
65+
Description: "Server backup schedule datasource schema. Must have a `region` specified in the provider configuration.",
8166
Attributes: map[string]schema.Attribute{
8267
"id": schema.StringAttribute{
8368
Description: "Terraform's internal resource identifier. It is structured as \"`project_id`,`server_id`,`backup_schedule_id`\".",

stackit/internal/services/serverbackup/schedule/schedules_datasource.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,13 @@ import (
1313
"github.com/hashicorp/terraform-plugin-framework/types"
1414
"github.com/hashicorp/terraform-plugin-log/tflog"
1515
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
16-
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features"
1716
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils"
1817
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate"
1918

2019
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
2120
"github.com/stackitcloud/stackit-sdk-go/services/serverbackup"
2221
)
2322

24-
// scheduleDataSourceBetaCheckDone is used to prevent multiple checks for beta resources.
25-
// This is a workaround for the lack of a global state in the provider and
26-
// needs to exist because the Configure method is called twice.
27-
var schedulesDataSourceBetaCheckDone bool
28-
2923
// Ensure the implementation satisfies the expected interfaces.
3024
var (
3125
_ datasource.DataSource = &schedulesDataSource{}
@@ -55,14 +49,6 @@ func (r *schedulesDataSource) Configure(ctx context.Context, req datasource.Conf
5549
return
5650
}
5751

58-
if !schedulesDataSourceBetaCheckDone {
59-
features.CheckBetaResourcesEnabled(ctx, &r.providerData, &resp.Diagnostics, "stackit_server_backup_schedules", "data source")
60-
if resp.Diagnostics.HasError() {
61-
return
62-
}
63-
schedulesDataSourceBetaCheckDone = true
64-
}
65-
6652
apiClient := serverbackupUtils.ConfigureClient(ctx, &r.providerData, &resp.Diagnostics)
6753
if resp.Diagnostics.HasError() {
6854
return
@@ -75,8 +61,7 @@ func (r *schedulesDataSource) Configure(ctx context.Context, req datasource.Conf
7561
// Schema defines the schema for the data source.
7662
func (r *schedulesDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
7763
resp.Schema = schema.Schema{
78-
Description: "Server backup schedules datasource schema. Must have a `region` specified in the provider configuration.",
79-
MarkdownDescription: features.AddBetaDescription("Server backup schedules datasource schema. Must have a `region` specified in the provider configuration.", core.Datasource),
64+
Description: "Server backup schedules datasource schema. Must have a `region` specified in the provider configuration.",
8065
Attributes: map[string]schema.Attribute{
8166
"id": schema.StringAttribute{
8267
Description: "Terraform's internal data source identifier. It is structured as \"`project_id`,`server_id`\".",

0 commit comments

Comments
 (0)