Skip to content

Commit

Permalink
Merge pull request #197 from OpsLevel/db/export-parent-teams-from-ter…
Browse files Browse the repository at this point in the history
…raform

Db/export parent teams from terraform
  • Loading branch information
davidbloss authored Oct 31, 2023
2 parents 12d672f + aa845ee commit d9a38c1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changes/unreleased/Feature-20231030-155711.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Feature
body: add parent field to exported opslevel_team terraform resource
time: 2023-10-30T15:57:11.071803-05:00
11 changes: 10 additions & 1 deletion src/cmd/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ func exportTeams(c *opslevel.Client, config *os.File, shell *os.File) {
teamConfig := `resource "opslevel_team" "%s" {
name = "%s"
manager_email = "%s"
parent = "%s"
%s
%s
}
Expand All @@ -325,7 +326,15 @@ func exportTeams(c *opslevel.Client, config *os.File, shell *os.File) {
if len(aliases) > 0 {
aliases = fmt.Sprintf("aliases = [\"%s\"]", aliases)
}
config.WriteString(templateConfig(teamConfig, team.Alias, team.Name, team.Manager.Email, aliases, buildMultilineStringArg("responsibilities", team.Responsibilities)))
config.WriteString(templateConfig(
teamConfig,
team.Alias,
team.Name,
team.Manager.Email,
team.ParentTeam.Alias,
aliases,
buildMultilineStringArg("responsibilities", team.Responsibilities),
))
shell.WriteString(fmt.Sprintf("terraform import opslevel_team.%s %s\n", team.Alias, team.Id))
}
shell.WriteString("##########\n\n")
Expand Down
2 changes: 1 addition & 1 deletion src/submodules/opslevel-go
Submodule opslevel-go updated 58 files
+1 −0 Taskfile.yml
+1 −1 actions_test.go
+17 −13 category_test.go
+10 −4 clientGQL_test.go
+5 −5 dependencies_test.go
+20 −21 domain_test.go
+168 −106 gen.go
+36 −25 group_test.go
+11 −11 infra_test.go
+13 −13 integration_test.go
+2 −2 job_test.go
+4 −4 level_test.go
+11 −11 repository_test.go
+2 −2 service_test.go
+21 −22 system_test.go
+8 −8 tags_test.go
+118 −73 team_test.go
+1 −1 testdata/fixtures/group/delete_request.json
+0 −7 testdata/fixtures/group/delete_response.json
+1 −1 testdata/fixtures/group/delete_with_alias_request.json
+0 −10 testdata/fixtures/team/add_contact_request.json
+0 −13 testdata/fixtures/team/add_contact_response.json
+0 −16 testdata/fixtures/team/add_member_response.json
+0 −1 testdata/fixtures/team/delete_request.json
+0 −9 testdata/fixtures/team/delete_response.json
+0 −1 testdata/fixtures/team/delete_with_alias_request.json
+0 −6 testdata/fixtures/team/get_request.json
+0 −6 testdata/fixtures/team/get_with_alias_request.json
+0 −7 testdata/fixtures/team/list_request.json
+0 −8 testdata/fixtures/team/remove_contact_request.json
+0 −8 testdata/fixtures/team/remove_contact_response.json
+0 −15 testdata/fixtures/team/remove_member_request.json
+0 −16 testdata/fixtures/team/remove_member_response.json
+0 −10 testdata/fixtures/team/update_contact_nil_type_request.json
+0 −11 testdata/fixtures/team/update_contact_request.json
+0 −13 testdata/fixtures/team/update_contact_response.json
+4 −4 testdata/templates/categories.tpl
+2 −2 testdata/templates/check.tpl
+9 −5 testdata/templates/common.tpl
+2 −2 testdata/templates/custom_actions.tpl
+6 −6 testdata/templates/domains.tpl
+4 −4 testdata/templates/filters.tpl
+2 −2 testdata/templates/groups.tpl
+6 −6 testdata/templates/infrastructure.tpl
+4 −4 testdata/templates/integrations.tpl
+4 −4 testdata/templates/levels.tpl
+7 −7 testdata/templates/lifecycle.tpl
+2 −2 testdata/templates/repository.tpl
+9 −9 testdata/templates/secrets.tpl
+4 −4 testdata/templates/service/contacts.tpl
+10 −10 testdata/templates/service/dependency.tpl
+3 −3 testdata/templates/service/service.tpl
+6 −6 testdata/templates/systems.tpl
+7 −7 testdata/templates/teams.tpl
+5 −5 testdata/templates/tiers.tpl
+5 −5 testdata/templates/tools.tpl
+3 −3 tools_test.go
+4 −4 user_test.go

0 comments on commit d9a38c1

Please sign in to comment.