Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TempRemount ¶
func TempRemount(logf log.Func, dest string, ignorePrefixes ...string) (restore func() error, err error, )
TempRemount iterates through all read-only mounted filesystems, bind-mounts them at dest, and unmounts them from their original source. All mount points underneath ignorePrefixes will not be touched.
Some container runtimes such as sysbox-runc will mount in `/lib/modules` read-only. See https://github.com/nestybox/sysbox/issues/564 This trips us up because:
- We call a Kaniko library function `util.DeleteFilesystem` that does exactly what it says on the tin. If this hits a read-only volume mounted in, unhappiness is the result.
- After deleting the filesystem and building the image, we extract it to the filesystem. If some paths mounted in via volume are present at that time, unhappiness is also likely to result -- especially in case of read-only mounts.
To work around this we move the mounts out of the way temporarily by bind-mounting them while we do our thing, and move them back when we're done.
It is the responsibility of the caller to call the returned function to restore the original mount points. If an error is encountered while attempting to perform the operation, calling the returned function will make a best-effort attempt to restore the original state.
Types ¶
type InvalidRepoURLError ¶ added in v1.3.0
type InvalidRepoURLError struct {
// contains filtered or unexported fields
}
func (*InvalidRepoURLError) Error ¶ added in v1.3.0
func (e *InvalidRepoURLError) Error() string
type ParsedURL ¶ added in v1.3.0
type ParsedURL struct {
Protocol string
User string
Password string
Host string
Port int
Path string
Reference string
Cleaned string
}
func ParseRepoURL ¶ added in v1.3.0
ParseRepoURL parses the given repository URL into its components. We used to use chainguard-dev/git-urls for this, but its behaviour diverges from the go-git URL parser. To ensure consistency, we now use go-git directly.