Skip to content

Commit

Permalink
deprecate ownerAlias (#191)
Browse files Browse the repository at this point in the history
* ownerAlias deprecated for service inputs

* pointer

* fix mistakes in service.go

Co-authored-by: Kyle Rockman <[email protected]>

* s/owner_alias/owner

---------

Co-authored-by: Kyle Rockman <[email protected]>
  • Loading branch information
taimoor ahmad and rocktavious authored Oct 25, 2023
1 parent a1e504a commit a3afe0a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .changes/unreleased/Refactor-20231020-134153.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Refactor
body: BREAKING CHANGE ownerAlias deprecated on service inputs
time: 2023-10-20T13:41:53.279163-04:00
9 changes: 5 additions & 4 deletions src/cmd/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ product: "OSS"
language: "Go"
tier: "tier_4"
framework: "fasthttp"
owner: "Platform"
owner:
alias: "Platform"
EOF`,
Run: func(cmd *cobra.Command, args []string) {
input, err := readServiceCreateInput()
Expand Down Expand Up @@ -207,15 +208,15 @@ EOF
}
}
lifecycle := reader.Text("Lifecycle")
if tier != "" {
if lifecycle != "" {
if item, ok := opslevel.Cache.Lifecycles[lifecycle]; ok {
input.Lifecycle = item.Alias
}
}
owner := reader.Text("Owner")
if tier != "" {
if owner != "" {
if item, ok := opslevel.Cache.Teams[owner]; ok {
input.Owner = item.Alias
input.Owner = opslevel.NewIdentifier(item.Alias)
}
}
service, err := getClientGQL().CreateService(input)
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func flattenTier(value opslevel.Tier) string {

func flattenOwner(value opslevel.TeamId) string {
if value.Id != "" {
return fmt.Sprintf("owner_alias = opslevel_team.%s.alias", value.Alias)
return fmt.Sprintf("owner = opslevel_team.%s.alias", value.Alias)
}
return ""
}
Expand Down
2 changes: 1 addition & 1 deletion src/submodules/opslevel-go

0 comments on commit a3afe0a

Please sign in to comment.