Skip to content

Commit 14b3165

Browse files
committed
Fixed formatting
1 parent 5728231 commit 14b3165

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

cmd/servicelog/post.go

+11-12
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ func (o *PostCmdOptions) Run() error {
195195
log.Fatal("servicelog post command terminated")
196196
}()
197197

198-
// cluster type for which documentation link is provided in servicelog description
199-
docClusterType := getDocClusterType(o.Message.Description)
198+
// cluster type for which documentation link is provided in servicelog description
199+
docClusterType := getDocClusterType(o.Message.Description)
200200

201201
for _, cluster := range clusters {
202202
request, err := o.createPostRequest(ocmClient, cluster)
@@ -205,18 +205,18 @@ func (o *PostCmdOptions) Run() error {
205205
continue
206206
}
207207

208-
// if servicelog description contains a documentation link, verify that
208+
// if servicelog description contains a documentation link, verify that
209209
// documentation link matches the cluster product (rosa, dedicated)
210-
if !o.skipPrompts && docClusterType != "" {
210+
if !o.skipPrompts && docClusterType != "" {
211211
clusterType := cluster.Product().ID()
212212

213-
if(docClusterType != clusterType){
213+
if docClusterType != clusterType {
214214
log.Info("The documentation link in the servicelog is for '", docClusterType, "' while the servicelog itself is for cluster type '", clusterType, "'.")
215215
if !ocmutils.ConfirmPrompt() {
216-
log.Info("Skipping cluster ID: ", cluster.ID() , ", Name: ", cluster.Name())
216+
log.Info("Skipping cluster ID: ", cluster.ID(), ", Name: ", cluster.Name())
217217
continue
218218
}
219-
}
219+
}
220220
}
221221

222222
response, err := ocmutils.SendRequest(request)
@@ -231,20 +231,19 @@ func (o *PostCmdOptions) Run() error {
231231
o.printPostOutput()
232232
return nil
233233
}
234-
235234

236235
// if servicelog description contains documentation link, parse and return the cluster type from the url
237-
func getDocClusterType(message string) string{
236+
func getDocClusterType(message string) string {
238237
descSubstrings := strings.Split(message, " ")
239238

240239
for _, s := range descSubstrings {
241-
if strings.Contains(s, documentationBaseURL) {
240+
if strings.Contains(s, documentationBaseURL) {
242241
t := strings.Split(s, "/")
243242
p := t[3]
244243
if p == "dedicated" {
245-
// the documentation urls for osd use "dedicated" as the differentiator
244+
// the documentation urls for osd use "dedicated" as the differentiator
246245
// e.g. https://docs.openshift.com/dedicated/welcome/index.html
247-
// for proper comparison with cluster product types, return "osd"
246+
// for proper comparison with cluster product types, return "osd"
248247
// where "dedicated" is used in the documentation urls
249248
p = "osd"
250249
}

0 commit comments

Comments
 (0)