Skip to content

Commit

Permalink
fix minor comments
Browse files Browse the repository at this point in the history
Signed-off-by: Young Bu Park <[email protected]>
  • Loading branch information
youngbupark committed Jan 25, 2024
1 parent 4555e24 commit bb5fede
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions pkg/corerp/frontend/controller/applications/graph_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,18 +508,18 @@ func connectionsFromAPIData(resource generated.GenericResource, allResources []g
return entries
}

// findSourceResource finds resource id by using source string by the following criteria:
// 1. It immediately returns return the resource ID if the source is a resource ID.
// 2. Parse the hostname and look up the hostname from the resource list if the source is an URL.
// findSourceResource looks up resource id by using source string by the following steps:
// 1. Immediately return the resource ID if the source is a valid resource ID.
// 2. Parse the hostname from source and look up the hostname in the resource list if the source is a valid URL.
// 3. Otherwise, return the original source string with false boolean value.
func findSourceResource(source string, allResources []generated.GenericResource) (string, bool) {
// 1. Return if the source is a resource ID
// 1. Return the resource id if the source is a valid resource ID
id, err := resources.Parse(source)
if err == nil && id.IsResource() {
return id.String(), true
}

// 2. Parse hostname from source and look up hostname from resource list.
// 2. Parse hostname from source and look up hostname in resource list.
orig := source

// Add "//" to source to enable url.Parse to parse source correctly if the scheme is not given.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@
},
"type": "Applications.Core/containers"
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
"provisioningState": "Succeeded",
"type": "Applications.Core/containers"
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
},
"type": "Applications.Core/containers"
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
"provisioningState": "Succeeded",
"type": "Applications.Core/containers"
}
]
]

0 comments on commit bb5fede

Please sign in to comment.