From b7972499a8f859f6721de0216d49ec5373562bdf Mon Sep 17 00:00:00 2001 From: Simon Johansson Date: Fri, 27 Sep 2024 11:56:49 +0200 Subject: [PATCH] Remove Department and Domain for now..and ever --- .../provider-install-verification/main.tf | 4 +-- internal/client/platform.go | 8 +++--- internal/provider/teams_data_source.go | 26 +++++-------------- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/examples/provider-install-verification/main.tf b/examples/provider-install-verification/main.tf index 2bc6fc9..96d05fe 100644 --- a/examples/provider-install-verification/main.tf +++ b/examples/provider-install-verification/main.tf @@ -7,7 +7,7 @@ terraform { } provider "ee-platform" { - platform_api = "localhost:8080" + platform_api = "https://ee-platform.springernature.app:8080" } data "ee-platform_teams" "all_teams" {} @@ -21,5 +21,5 @@ output "teams" { resource "local_file" "foo" { for_each = data.ee-platform_teams.all_teams.teams filename = "/tmp/test/${each.key}" - content = "name = ${each.value.name}, department = ${each.value.department}" + content = "name = ${each.value.name}, id = ${each.value.id}" } \ No newline at end of file diff --git a/internal/client/platform.go b/internal/client/platform.go index aeb7a09..97eb8ab 100644 --- a/internal/client/platform.go +++ b/internal/client/platform.go @@ -11,11 +11,9 @@ import ( type Teams []Team type Team struct { - ID string `json:"id"` - Name string `json:"name"` - Department string `json:"department"` - Domain string `json:"domain"` - SnPaasOrg string `json:"snpaas_org"` + ID string `json:"id"` + Name string `json:"name"` + SnPaasOrg string `json:"snpaas_org"` } type PlatformClient interface { diff --git a/internal/provider/teams_data_source.go b/internal/provider/teams_data_source.go index bb6fe43..5ff2e6d 100644 --- a/internal/provider/teams_data_source.go +++ b/internal/provider/teams_data_source.go @@ -69,16 +69,6 @@ func (d *teamsDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, Description: "Team name", MarkdownDescription: "Team name", }, - "department": schema.StringAttribute{ - Required: true, - Description: "SN department the team is part of", - MarkdownDescription: "SN department the team is part of", - }, - "domain": schema.StringAttribute{ - Optional: true, - Description: "SN Digital domain the team is part of", - MarkdownDescription: "SN Digital domain the team is part of", - }, "snpaas_org": schema.StringAttribute{ Optional: true, Description: "SNPaaS Cloud Foundry organization that the team deploys to", @@ -103,11 +93,9 @@ func (d *teamsDataSource) Read(ctx context.Context, req datasource.ReadRequest, for _, team := range teams { state.Teams[team.ID] = teamsModel{ - ID: types.StringValue(team.ID), - Name: types.StringValue(team.Name), - Department: types.StringValue(team.Department), - Domain: types.StringValue(team.Domain), - SnPaasOrg: types.StringValue(team.SnPaasOrg), + ID: types.StringValue(team.ID), + Name: types.StringValue(team.Name), + SnPaasOrg: types.StringValue(team.SnPaasOrg), } } @@ -123,9 +111,7 @@ type teamsDataSourceModel struct { } type teamsModel struct { - ID types.String `tfsdk:"id"` - Name types.String `tfsdk:"name"` - Department types.String `tfsdk:"department"` - Domain types.String `tfsdk:"domain"` - SnPaasOrg types.String `tfsdk:"snpaas_org"` + ID types.String `tfsdk:"id"` + Name types.String `tfsdk:"name"` + SnPaasOrg types.String `tfsdk:"snpaas_org"` }