Skip to content

Commit 66b6a39

Browse files
committed
fix(cockpit): ignore deprecated field plan
1 parent 494bc9e commit 66b6a39

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

docs/resources/cockpit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ page_title: "Scaleway: scaleway_cockpit"
99
As of September 2024, Cockpit has introduced [regionalization](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#region) to offer more flexibility and resilience.
1010
If you have created customized dashboards with data for your Scaleway resources before April 2024, you will need to update your queries in Grafana, with the new regionalized [data sources](../resources/cockpit_source.md).
1111

12+
-> **Note:**
13+
Cockpit plans scheduled for deprecation on January 1st 2025.
14+
The retention period previously set for your logs and metrics will remain the same after that date.
15+
You will be able to edit the retention period for your metrics, logs, and traces for free during Beta.
16+
1217
Please note that even if you provide the grafana_url, it will only be active if a [Grafana user](../resources/cockpit_grafana_user.md) is created first. Make sure to create a Grafana user in your Cockpit instance to enable full access to Grafana.
1318

1419
The `scaleway_cockpit` resource allows you to create and manage Scaleway Cockpit instances.

internal/services/cockpit/cockpit.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func ResourceCockpitCreate(ctx context.Context, d *schema.ResourceData, m interf
103103
if targetPlanI, ok := d.GetOk("plan"); ok {
104104
targetPlan := targetPlanI.(string)
105105

106-
plans, err := api.ListPlans(&cockpit.GlobalAPIListPlansRequest{}, scw.WithContext(ctx), scw.WithAllPages())
106+
plans, err := api.ListPlans(&cockpit.GlobalAPIListPlansRequest{}, scw.WithContext(ctx), scw.WithAllPages()) //nolint:staticcheck
107107
if err != nil {
108108
return diag.FromErr(err)
109109
}
@@ -120,7 +120,7 @@ func ResourceCockpitCreate(ctx context.Context, d *schema.ResourceData, m interf
120120
return diag.Errorf("plan %s not found", targetPlan)
121121
}
122122

123-
_, err = api.SelectPlan(&cockpit.GlobalAPISelectPlanRequest{
123+
_, err = api.SelectPlan(&cockpit.GlobalAPISelectPlanRequest{ //nolint:staticcheck
124124
ProjectID: projectID,
125125
PlanName: cockpit.PlanName(planName),
126126
}, scw.WithContext(ctx))
@@ -150,8 +150,8 @@ func ResourceCockpitRead(ctx context.Context, d *schema.ResourceData, m interfac
150150
return diag.FromErr(err)
151151
}
152152
}
153-
154-
res, err := api.GetCurrentPlan(&cockpit.GlobalAPIGetCurrentPlanRequest{
153+
154+
res, err := api.GetCurrentPlan(&cockpit.GlobalAPIGetCurrentPlanRequest{ //nolint:staticcheck
155155
ProjectID: projectID,
156156
}, scw.WithContext(ctx))
157157
if err != nil {

0 commit comments

Comments
 (0)