Skip to content

Commit 73f3b0e

Browse files
committed
CLEANUP/MINOR: tighten three comments carried over from v1.2.0
Same pass as the surrounding commits, applied to comments that predate this branch: state the intent and drop the restatement of the code below.
1 parent 46f00c2 commit 73f3b0e

3 files changed

Lines changed: 9 additions & 11 deletions

File tree

daemon.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,8 @@ var errServiceReplaced = fmt.Errorf("service replaced or removed by reload")
114114
// rather than double-forking. Callers must not treat it as fatal.
115115
var errAlreadyRunning = fmt.Errorf("service already running")
116116

117-
// errConditionUnmet is returned by startService when a file condition blocks
118-
// the start. startService already logged the skip; callers must treat it as a
119-
// benign non-start, never as a failure.
117+
// errConditionUnmet reports a start blocked by a file condition. startService
118+
// has already logged the skip; it is a benign non-start, not a failure.
120119
var errConditionUnmet = fmt.Errorf("start condition not met")
121120

122121
// daemon holds all mutable daemon state so reload can update it.

internal/yml/config.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -568,10 +568,9 @@ func parseProcess(n *Node, env map[string]string) (service.Process, error) {
568568
// ({{file}}, {{.VAR}}). {{cpu}}/{{mem}} expand to integers, so excluded.
569569
var argSecretTemplateRe = regexp.MustCompile(`\{\{\s*(?:file\b|\.)`)
570570

571-
// requireMapping rejects a value that cannot hold a key-value table. A scalar
572-
// or a list parses to an empty map, so without this the whole setting would be
573-
// silently ignored until a child exits. An absent key, or a bare "key:" with no
574-
// entries, stays legal.
571+
// requireMapping rejects a value that cannot hold a key-value table: a scalar
572+
// or list parses to an empty map, so the setting would be ignored in silence
573+
// until a child exits. An absent key, or a bare "key:", stays legal.
575574
func requireMapping(n *Node, key, procName, command string) error {
576575
v := n.Get(key)
577576
if v == nil || v.kind == kindMapping {

service/condition.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ import (
2525
// human-readable reason when a start should be skipped, or "" to proceed.
2626
//
2727
// os.Stat follows symlinks so a k8s ..data mount resolves to its target and a
28-
// dangling symlink counts as missing. The check is advisory: the file state
29-
// can change between this probe and the exec (inherent TOCTOU). A Stat error
30-
// other than not-exist leaves the condition unmet with the error in the
31-
// reason, so e.g. a permission problem never masquerades as a missing file.
28+
// dangling symlink counts as missing. The check is advisory: the state can
29+
// change between this probe and the exec. A Stat error other than not-exist
30+
// leaves the condition unmet and names the error, so a permission problem
31+
// never masquerades as a missing file.
3232
func (p *Process) UnmetCondition() string {
3333
if p.ConditionFileExists != "" {
3434
exists, err := fileExists(p.ConditionFileExists)

0 commit comments

Comments
 (0)