MCPcopy Create free account
hub / github.com/Mirantis/cri-dockerd / removeContainerLogSymlink

Method removeContainerLogSymlink

core/logs.go:206–224  ·  view source on GitHub ↗

removeContainerLogSymlink removes the symlink for docker container log.

(containerID string)

Source from the content-addressed store, hash-verified

204
205// removeContainerLogSymlink removes the symlink for docker container log.
206func (ds *dockerService) removeContainerLogSymlink(containerID string) error {
207 path, _, err := ds.getContainerLogPath(containerID)
208 if err != nil {
209 return fmt.Errorf("failed to get container %q log path: %v", containerID, err)
210 }
211 if path != "" {
212 // Only remove the symlink when container log path is specified.
213 err := ds.os.Remove(path)
214 if err != nil && !os.IsNotExist(err) {
215 return fmt.Errorf(
216 "failed to remove container %q log symlink %q: %v",
217 containerID,
218 path,
219 err,
220 )
221 }
222 }
223 return nil
224}

Callers 1

RemoveContainerMethod · 0.95

Calls 2

getContainerLogPathMethod · 0.95
RemoveMethod · 0.65

Tested by

no test coverage detected