Skip to content

Commit 1305e67

Browse files
authored
move server update out of beta (#1267)
1 parent 0cfc05b commit 1305e67

6 files changed

Lines changed: 3 additions & 49 deletions

File tree

docs/data-sources/server_update_schedule.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ page_title: "stackit_server_update_schedule Data Source - stackit"
44
subcategory: ""
55
description: |-
66
Server update 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_update_schedule (Data Source)
1110

1211
Server update 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_update_schedules.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ page_title: "stackit_server_update_schedules Data Source - stackit"
44
subcategory: ""
55
description: |-
66
Server update 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_update_schedules (Data Source)
1110

1211
Server update 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_update_schedule.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ page_title: "stackit_server_update_schedule Resource - stackit"
44
subcategory: ""
55
description: |-
66
Server update 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_update_schedule (Resource)
1110

1211
Server update 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/serverupdate/schedule/resource.go

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

2525
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion"
2626
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
27-
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features"
2827
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate"
2928

3029
"github.com/stackitcloud/stackit-sdk-go/core/oapierror"
@@ -105,11 +104,6 @@ func (r *scheduleResource) Configure(ctx context.Context, req resource.Configure
105104
return
106105
}
107106

108-
features.CheckBetaResourcesEnabled(ctx, &r.providerData, &resp.Diagnostics, "stackit_server_update_schedule", "resource")
109-
if resp.Diagnostics.HasError() {
110-
return
111-
}
112-
113107
apiClient := serverupdateUtils.ConfigureClient(ctx, &r.providerData, &resp.Diagnostics)
114108
if resp.Diagnostics.HasError() {
115109
return
@@ -121,8 +115,7 @@ func (r *scheduleResource) Configure(ctx context.Context, req resource.Configure
121115
// Schema defines the schema for the resource.
122116
func (r *scheduleResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
123117
resp.Schema = schema.Schema{
124-
Description: "Server update schedule resource schema. Must have a `region` specified in the provider configuration.",
125-
MarkdownDescription: features.AddBetaDescription("Server update schedule resource schema. Must have a `region` specified in the provider configuration.", core.Resource),
118+
Description: "Server update schedule resource schema. Must have a `region` specified in the provider configuration.",
126119
Attributes: map[string]schema.Attribute{
127120
"id": schema.StringAttribute{
128121
Description: "Terraform's internal resource identifier. It is structured as \"`project_id`,`region`,`server_id`,`update_schedule_id`\".",

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

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,11 @@ import (
1616
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils"
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/validate"
2120

2221
"github.com/stackitcloud/stackit-sdk-go/services/serverupdate"
2322
)
2423

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

59-
if !scheduleDataSourceBetaCheckDone {
60-
features.CheckBetaResourcesEnabled(ctx, &r.providerData, &resp.Diagnostics, "stackit_server_update_schedule", "data source")
61-
if resp.Diagnostics.HasError() {
62-
return
63-
}
64-
scheduleDataSourceBetaCheckDone = true
65-
}
66-
6753
apiClient := serverupdateUtils.ConfigureClient(ctx, &r.providerData, &resp.Diagnostics)
6854
if resp.Diagnostics.HasError() {
6955
return
@@ -75,8 +61,7 @@ func (r *scheduleDataSource) Configure(ctx context.Context, req datasource.Confi
7561
// Schema defines the schema for the data source.
7662
func (r *scheduleDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
7763
resp.Schema = schema.Schema{
78-
Description: "Server update schedule datasource schema. Must have a `region` specified in the provider configuration.",
79-
MarkdownDescription: features.AddBetaDescription("Server update schedule datasource schema. Must have a `region` specified in the provider configuration.", core.Datasource),
64+
Description: "Server update schedule 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 resource identifier. It is structured as \"`project_id`,`region`,`server_id`,`update_schedule_id`\".",

stackit/internal/services/serverupdate/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/serverupdate"
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_update_schedules", "data source")
60-
if resp.Diagnostics.HasError() {
61-
return
62-
}
63-
schedulesDataSourceBetaCheckDone = true
64-
}
65-
6652
apiClient := serverupdateUtils.ConfigureClient(ctx, &r.providerData, &resp.Diagnostics)
6753
if resp.Diagnostics.HasError() {
6854
return
@@ -74,8 +60,7 @@ func (r *schedulesDataSource) Configure(ctx context.Context, req datasource.Conf
7460
// Schema defines the schema for the data source.
7561
func (r *schedulesDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
7662
resp.Schema = schema.Schema{
77-
Description: "Server update schedules datasource schema. Must have a `region` specified in the provider configuration.",
78-
MarkdownDescription: features.AddBetaDescription("Server update schedules datasource schema. Must have a `region` specified in the provider configuration.", core.Datasource),
63+
Description: "Server update schedules datasource schema. Must have a `region` specified in the provider configuration.",
7964
Attributes: map[string]schema.Attribute{
8065
"id": schema.StringAttribute{
8166
Description: "Terraform's internal data source identifier. It is structured as \"`project_id`,`region`,`server_id`\".",

0 commit comments

Comments
 (0)