Documentation
¶
Index ¶
- func InstalledDir(p naming.Path) string
- func Keywords(prefix string) []*keywords.Keyword
- func ModeHasSpecialBits(s string) bool
- func Pop(words []string) (string, []string)
- func Split(text []string) [][]string
- func TextHasLocalSource(s string) bool
- func TextHasSpecialMode(s string) bool
- func ValidateInstall(value string) error
- type DataRecv
- func (t *DataRecv) DatastoreList(_ context.Context) naming.Paths
- func (t *DataRecv) Do(ctx context.Context) error
- func (t *DataRecv) HasMetadata(path naming.Path, k string) bool
- func (t *DataRecv) InstallDataByKind(kind naming.Kind) (bool, error)
- func (t *DataRecv) InstallFromDatastore(ctx context.Context, from object.DataStore) (bool, error)
- func (t *DataRecv) OldSendSignals(ctx context.Context) error
- func (t *DataRecv) RootDirPerm() *os.FileMode
- func (t *DataRecv) RunInstall(ctx context.Context) error
- func (t *DataRecv) SendSignals(ctx context.Context, signals *volsignal.T) error
- func (t *DataRecv) SetReceiver(to receiver)
- func (t *DataRecv) Status()
- type Installed
- type KeyMeta
- type SigRoute
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstalledDir ¶
InstalledDir returns the directory holding the install records of the resources of the instance of p, a file named after each resource.
func ModeHasSpecialBits ¶
ModeHasSpecialBits reports whether a perm or dirperm value asks for the setuid or the setgid bit.
A file installed in a volume with one of them, owned by an account of the node, runs as that account for whoever executes it: on the node, where the volume is mounted, or in a container mounting the volume.
func Pop ¶
Pop returns "a", "b c d" from "a b c d". This function is used in a loop to iterate all words of a line until Pop returns "", "".
func TextHasLocalSource ¶
TextHasLocalSource reports whether an install text names a source the server reads locally, as opposed to one it fetches over http.
It lives here, next to the grammar it parses, so the rbac policy that refuses a local source to a user holding no root grant does not have to reimplement that grammar and drift from it.
func TextHasSpecialMode ¶
TextHasSpecialMode reports whether an install text asks for the setuid or the setgid bit on one of the files or directories it installs.
Such a mode is not applied today: the mode word is read as permission bits alone. It is refused anyway, so a mode that would be applied once the grammar honours the bits is not one a user holding no root grant has already written.
func ValidateInstall ¶
ValidateInstall says whether the install lines of value are ones the install takes, as far as the lines naming datastores by a pattern go: their pattern, and the * of their destination, the files of the datastores having to be told apart.
Types ¶
type DataRecv ¶
type DataRecv struct {
// Install is the list of files or directories to install in the data receiver.
Install []string `json:"install"`
// User is the default owner user of the installed items.
User string `json:"user"`
// Group is the default owner group of the installed items.
Group string `json:"group"`
// Perm is the default permission of the installed files.
Perm *os.FileMode `json:"perm"`
// DirPerm is the default permission of the installed directories.
// If not set, DirPerm defaults to Perm with execution bit over read bits (e.g. 0640 => 0750).
DirPerm *os.FileMode `json:"dirperm"`
// Deprecated by Install
Configs []string `json:"configs"`
Secrets []string `json:"secrets"`
Directories []string `json:"directories"`
Signal string `json:"signal"`
// contains filtered or unexported fields
}
func (*DataRecv) HasMetadata ¶
HasMetadata returns true if the volume has a configs or secrets reference to <namespace>/<kind>/<name>[/<key>]
func (*DataRecv) InstallDataByKind ¶
func (*DataRecv) InstallFromDatastore ¶
func (*DataRecv) RootDirPerm ¶
func (*DataRecv) RunInstall ¶
RunInstall installs what the data receiver declares, as a start does, and logs what it leaves as it is too, and why: a directory in place, a file up to date, a key the store does not hold, a store that does not exist.
func (*DataRecv) SendSignals ¶
func (*DataRecv) SetReceiver ¶
func (t *DataRecv) SetReceiver(to receiver)
type Installed ¶
Installed is the record of the last install of a resource that wrote files: the daemon watching it tells the tasks reading them.
func ReadInstalled ¶
ReadInstalled returns the install record of the file filename.
type KeyMeta ¶
func ParseKeyMetaRel ¶
func ParseKeyMetaRelWithFallback ¶
ParseKeyMetaRelWithFallback parses a key reference in the format "from <path> key <key>" and falls back to the legacy format "<path>" with a default key name for backward compatibility.