added pool finder
This commit is contained in:
parent
07f48d4369
commit
59ad9d8ec5
3 changed files with 53 additions and 11 deletions
|
|
@ -40,3 +40,11 @@ func ParseURL(s string) (pool, node, id string, err error) {
|
|||
func NewURL(pool, node, id string) string {
|
||||
return fmt.Sprintf("%s://%s/%s/%s", PVEScheme, pool, node, id)
|
||||
}
|
||||
|
||||
func K8sURL(url string) (string, error) {
|
||||
pool, _, id, err := ParseURL(url)
|
||||
if err != nil {
|
||||
return "", nil
|
||||
}
|
||||
return NewURL(pool, "", id), nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue