filesystem

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureDirectoryExists

func EnsureDirectoryExists(path string) error

EnsureDirectoryExists creates a directory if it does not exist it returns an error if it fails

func EnsureSymbolicLink(source, target string) error

EnsureSymbolicLink preserves a correct link and replaces any other target.

func ExtractBinary

func ExtractBinary(compressed []byte, destFile string) error

ExtractBinary extracts a zstd-compressed binary and installs it to destFile. TODO: get the SHA of each binary and compare it to the expected SHA

func FileExists

func FileExists(path string) bool

FileExists checks if a file exists it returns true if the file exists, false otherwise

func RemoveIfSymlink(path string) bool

RemoveIfSymlink removes path only when it is a symlink, and reports whether it did. A regular file, directory or socket at that path is left untouched.

This guards the shared paths kubesolo publishes itself into, such as the standard containerd socket: kubesolo installs a symlink there, whereas a container runtime managed by the host binds a real socket at the same path. os.Stat follows symlinks and so cannot tell the two apart; os.Lstat does not.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL