Skip to content

Commit b09cdcc

Browse files
committed
feat(cockpit): change source origin from external to custom (#3481)
* feat(cockpit): change source origin from external to custom * chore(cockpit): compress cassette files * fix(cockpit): remove outdated Grafana URL format check * fix(cockpit): remove outdated Grafana URL format check * chore(cockpit): compress cockpit-basic cassette * chore(cockpit): compress data-source-cockpit-grafana-basic cassette
1 parent b919f45 commit b09cdcc

13 files changed

+1492
-746
lines changed

docs/data-sources/cockpit_sources.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ data "scaleway_cockpit_sources" "my_sources" {
3838
### Filter sources by origin
3939

4040
```hcl
41-
data "scaleway_cockpit_sources" "external" {
41+
data "scaleway_cockpit_sources" "custom" {
4242
project_id = "11111111-1111-1111-1111-111111111111"
43-
origin = "external"
43+
origin = "custom"
4444
}
4545
```
4646

@@ -61,7 +61,7 @@ The following arguments are supported:
6161
- `region` - (Optional) The region in which the cockpit sources are located.
6262
- `name` - (Optional) Filter sources by name.
6363
- `type` - (Optional) Filter sources by type. Possible values are: `metrics`, `logs`, `traces`.
64-
- `origin` - (Optional) Filter sources by origin. Possible values are: `scaleway`, `external`, `custom`.
64+
- `origin` - (Optional) Filter sources by origin. Possible values are: `scaleway`, `custom`.
6565

6666
## Attributes Reference
6767

internal/services/cockpit/cockpit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func ResourceCockpitRead(ctx context.Context, d *schema.ResourceData, m any) dia
141141
dataSourcesRes, err := regionalAPI.ListDataSources(&cockpit.RegionalAPIListDataSourcesRequest{
142142
Region: region,
143143
ProjectID: projectID,
144-
Origin: "external",
144+
Origin: "custom",
145145
}, scw.WithContext(ctx), scw.WithAllPages())
146146
if err != nil {
147147
return diag.FromErr(err)

internal/services/cockpit/cockpit_test.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cockpit_test
22

33
import (
4-
"fmt"
54
"testing"
65

76
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
@@ -56,7 +55,6 @@ func TestAccCockpit_Basic(t *testing.T) {
5655
resource.TestCheckResourceAttrSet("scaleway_cockpit.main", "plan"),
5756
resource.TestCheckResourceAttr("scaleway_cockpit.main", "plan", "free"),
5857
resource.TestCheckResourceAttrSet("scaleway_cockpit.main", "endpoints.0.grafana_url"),
59-
checkGrafanaURL("scaleway_cockpit.main", "scaleway_account_project.project"),
6058
),
6159
},
6260
},
@@ -128,20 +126,6 @@ func TestAccCockpit_WithSourceEndpoints(t *testing.T) {
128126
})
129127
}
130128

131-
func checkGrafanaURL(resourceName, projectResource string) resource.TestCheckFunc {
132-
return func(s *terraform.State) error {
133-
rs, ok := s.RootModule().Resources[projectResource]
134-
if !ok {
135-
return fmt.Errorf("Not found: %s", projectResource)
136-
}
137-
138-
projectID := rs.Primary.ID
139-
expectedURL := fmt.Sprintf("https://%s.dashboard.obs.fr-par.scw.cloud", projectID)
140-
141-
return resource.TestCheckResourceAttr(resourceName, "endpoints.0.grafana_url", expectedURL)(s)
142-
}
143-
}
144-
145129
func isCockpitDestroyed(_ *acctest.TestTools) resource.TestCheckFunc {
146130
return func(_ *terraform.State) error {
147131
return nil

0 commit comments

Comments
 (0)