Skip to content

Commit 9bbd7c4

Browse files
committed
CLI hotfix to make component type on services work
1 parent 6618d17 commit 9bbd7c4

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

src/cmd/service.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ parent:
4343
alias: "my_system"
4444
product: "OSS"
4545
tier: "tier_4"
46+
type:
47+
alias: "mobile-app"
4648
EOF`,
4749
Run: func(cmd *cobra.Command, args []string) {
4850
input, err := readResourceInput[opslevel.ServiceCreateInput]()
@@ -117,15 +119,15 @@ var listServiceCmd = &cobra.Command{
117119
common.JsonPrint(json.MarshalIndent(list, "", " "))
118120
} else if isCsvOutput() {
119121
w := csv.NewWriter(os.Stdout)
120-
w.Write([]string{"NAME", "ID", "ALIASES"})
122+
w.Write([]string{"NAME", "ID", "TYPE", "ALIASES"})
121123
for _, item := range list {
122-
w.Write([]string{item.Name, string(item.Id), strings.Join(item.Aliases, "/")})
124+
w.Write([]string{item.Name, string(item.Id), item.Type.Alias, strings.Join(item.Aliases, "/")})
123125
}
124126
w.Flush()
125127
} else {
126-
w := common.NewTabWriter("NAME", "ID", "ALIASES")
128+
w := common.NewTabWriter("NAME", "ID", "TYPE", "ALIASES")
127129
for _, item := range list {
128-
fmt.Fprintf(w, "%s\t%s\t%s\t\n", item.Name, item.Id, strings.Join(item.Aliases, ","))
130+
fmt.Fprintf(w, "%s\t%s\t%s\t%s\t\n", item.Name, item.Id, item.Type.Alias, strings.Join(item.Aliases, ","))
129131
}
130132
w.Flush()
131133
}
@@ -151,6 +153,8 @@ parent:
151153
alias: "my_system"
152154
product: "OSS"
153155
tier: "tier_3"
156+
type:
157+
alias: "mobile-app"
154158
EOF`,
155159
Run: func(cmd *cobra.Command, args []string) {
156160
input, err := readResourceInput[opslevel.ServiceUpdateInput]()

src/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@ require (
102102
sigs.k8s.io/yaml v1.4.0 // indirect
103103
)
104104

105-
// replace github.com/opslevel/opslevel-go/v2024 => ./submodules/opslevel-go
105+
replace github.com/opslevel/opslevel-go/v2024 => ./submodules/opslevel-go

src/go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ github.com/open-policy-agent/opa v0.67.1 h1:rzy26J6g1X+CKknAcx0Vfbt41KqjuSzx4E0A
194194
github.com/open-policy-agent/opa v0.67.1/go.mod h1:aqKlHc8E2VAAylYE9x09zJYr/fYzGX+JKne89UGqFzk=
195195
github.com/opslevel/moredefaults v0.0.0-20240529152742-17d1318a3c12 h1:OQZ3W8kbyCcdS8QUWFTnZd6xtdkfhdckc7Paro7nXio=
196196
github.com/opslevel/moredefaults v0.0.0-20240529152742-17d1318a3c12/go.mod h1:g2GSXVP6LO+5+AIsnMRPN+BeV86OXuFRTX7HXCDtYeI=
197-
github.com/opslevel/opslevel-go/v2024 v2024.12.24 h1:yqByehj/HBKcHV2xnZK9ozAhE+qQfXSWxtp6KLS1f9s=
198-
github.com/opslevel/opslevel-go/v2024 v2024.12.24/go.mod h1:cIwzFyu8HURaGdZKWtKn4pijsyYs8xP8uuDwqgohWgo=
199197
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
200198
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
201199
github.com/pjbgf/sha1cd v0.3.2 h1:a9wb0bp1oC2TGwStyn0Umc/IGKQnEgF0vVaZ8QF8eo4=

0 commit comments

Comments
 (0)