mirror of
https://github.com/labring/sealos.git
synced 2026-09-24 15:46:19 +08:00
fix: export function FormatReferenceWithTransportName (#2408)
Signed-off-by: fengxsong <fengxsong@outlook.com> Signed-off-by: fengxsong <fengxsong@outlook.com>
This commit is contained in:
@@ -69,11 +69,11 @@ var (
|
||||
TransportContainersStorage = storage.Transport.Name()
|
||||
)
|
||||
|
||||
func formatReferenceWithTransportName(tr string, ref string) string {
|
||||
func FormatReferenceWithTransportName(tr string, ref string) string {
|
||||
switch tr {
|
||||
case TransportAtomic, TransportDir, TransportDockerArchive, TransportOCI, TransportOCIArchive, TransportTarball, TransportSif:
|
||||
case TransportAtomic, TransportContainersStorage, TransportDir, TransportDockerArchive, TransportOCI, TransportOCIArchive, TransportTarball, TransportSif:
|
||||
return tr + ":" + ref
|
||||
case TransportContainersStorage, TransportDocker:
|
||||
case TransportDocker:
|
||||
return tr + "://" + ref
|
||||
default:
|
||||
panic(fmt.Errorf("unknown transport %s", tr))
|
||||
|
||||
@@ -125,7 +125,7 @@ func finalizeReference(transport types.ImageTransport, imgName string) (types.Im
|
||||
return transport, imgName
|
||||
}
|
||||
}
|
||||
return transport, formatReferenceWithTransportName(transport.Name(), imgName)
|
||||
return transport, FormatReferenceWithTransportName(transport.Name(), imgName)
|
||||
}
|
||||
|
||||
func (impl *realImpl) InspectImage(name string, opts ...string) (*v1.Image, error) {
|
||||
|
||||
Reference in New Issue
Block a user