mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-03-19 13:36:15 -04:00
versionsapi: fix shortPath implementation
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
parent
6dad94137b
commit
f17b40b44a
@ -320,12 +320,14 @@ var (
|
||||
func shortPath(ref, stream, version string) string {
|
||||
var sp string
|
||||
if ref != ReleaseRef {
|
||||
sp = path.Join("ref", ref)
|
||||
return path.Join("ref", ref, "stream", stream, version)
|
||||
}
|
||||
|
||||
if stream != "stable" {
|
||||
sp = path.Join(sp, "stream", stream)
|
||||
return path.Join(sp, "stream", stream, version)
|
||||
}
|
||||
return path.Join(sp, version)
|
||||
|
||||
return version
|
||||
}
|
||||
|
||||
func parseShortPath(shortPath string) (ref, stream, version string, err error) {
|
||||
|
@ -607,6 +607,11 @@ func TestShortPath(t *testing.T) {
|
||||
stream: "debug",
|
||||
version: "v9.9.9",
|
||||
},
|
||||
"ref/foo/stream/stable/v9.9.9": {
|
||||
ref: "foo",
|
||||
stream: "stable",
|
||||
version: "v9.9.9",
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range testCases {
|
||||
|
Loading…
x
Reference in New Issue
Block a user