MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / loadVolumeBinds

Function loadVolumeBinds

agent/app/service/container.go:1983–2002  ·  view source on GitHub ↗
(binds []container.MountPoint)

Source from the content-addressed store, hash-verified

1981}
1982
1983func loadVolumeBinds(binds []container.MountPoint) []dto.VolumeHelper {
1984 var datas []dto.VolumeHelper
1985 for _, bind := range binds {
1986 var volumeItem dto.VolumeHelper
1987 volumeItem.Type = string(bind.Type)
1988 if bind.Type == "volume" {
1989 volumeItem.SourceDir = bind.Name
1990 } else {
1991 volumeItem.SourceDir = bind.Source
1992 }
1993 volumeItem.ContainerDir = bind.Destination
1994 volumeItem.Mode = "ro"
1995 if bind.RW {
1996 volumeItem.Mode = "rw"
1997 }
1998 volumeItem.Shared = string(bind.Propagation)
1999 datas = append(datas, volumeItem)
2000 }
2001 return datas
2002}
2003
2004func loadPortByInspect(id string, client *client.Client) ([]container.Port, error) {
2005 containerItem, err := client.ContainerInspect(context.Background(), id)

Callers 1

ContainerInfoMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected