Skip to content

Commit

Permalink
Remove Department and Domain for now..and ever
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjohansson committed Sep 27, 2024
1 parent fc8b4ea commit b797249
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 27 deletions.
4 changes: 2 additions & 2 deletions examples/provider-install-verification/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {}
Expand All @@ -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}"
}
8 changes: 3 additions & 5 deletions internal/client/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
26 changes: 6 additions & 20 deletions internal/provider/teams_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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),
}
}

Expand All @@ -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"`
}

0 comments on commit b797249

Please sign in to comment.