misc: Fix typos and spelling errors

This commit is contained in:
Edward Toroshchyn
2025-02-24 15:59:00 +01:00
parent 1f90de31e7
commit c25a2a257b
40 changed files with 62 additions and 62 deletions

View File

@@ -193,7 +193,7 @@ type AwsEc2Res struct {
// UserData is used to run bash and cloud-init commands on first launch.
// See http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html
// for documantation and examples.
// for documentation and examples.
UserData string `lang:"userdata" yaml:"userdata"`
client *ec2.EC2 // client session for AWS API calls

View File

@@ -142,7 +142,7 @@ type CronRes struct {
WakeSystem bool `lang:"wakesystem" yaml:"wakesystem"`
// RemainAfterElapse, if true, means an elapsed timer will stay loaded,
// and its state remains queriable. If false, an elapsed timer unit that
// and its state remains queryable. If false, an elapsed timer unit that
// cannot elapse anymore is unloaded. It defaults to true.
RemainAfterElapse bool `lang:"remainafterelapse" yaml:"remainafterelapse"`
@@ -271,7 +271,7 @@ func (obj *CronRes) Watch(ctx context.Context) error {
//args = append(args, "eavesdrop='true'") // XXX: not allowed anymore?
args = append(args, fmt.Sprintf("arg2='%s.timer'", obj.Name()))
// match dbus messsages
// match dbus messages
if call := bus.BusObject().Call(engineUtil.DBusAddMatch, 0, strings.Join(args, ",")); call.Err != nil {
return call.Err
}

View File

@@ -1863,7 +1863,7 @@ func (obj *DHCPRangeRes) handler4(data *HostData) (func(*dhcpv4.DHCPv4, *dhcpv4.
// FIXME: Run this somewhere for now, eventually it should get scheduled
// to run in the returned duration of time. This way, it would clean old
// peristed entries when they're stale, not when a new request comes in.
// persisted entries when they're stale, not when a new request comes in.
if _, err := obj.leaseClean(); err != nil {
return nil, errwrap.Wrapf(err, "clean error")
}

View File

@@ -407,7 +407,7 @@ func (obj *DockerContainerRes) Cmp(r engine.Res) error {
return errwrap.Wrapf(err, "the Cmd field differs")
}
if err := util.SortedStrSliceCompare(obj.Env, res.Env); err != nil {
return errwrap.Wrapf(err, "tne Env field differs")
return errwrap.Wrapf(err, "the Env field differs")
}
if len(obj.Ports) != len(res.Ports) {
return fmt.Errorf("the Ports length differs")
@@ -461,7 +461,7 @@ func (obj *DockerContainerRes) AutoEdges() (engine.AutoEdge, error) {
}, nil
}
// Next returnes the next automatic edge.
// Next returns the next automatic edge.
func (obj *DockerContainerResAutoEdges) Next() []engine.ResUID {
if len(obj.UIDs) == 0 {
return nil

View File

@@ -145,7 +145,7 @@ type FileRes struct {
// Source specifies the source contents for the file resource. It cannot
// be combined with the Content or Fragments parameters. It must be an
// absolute path, and it can point to a file or a directory. If it
// points to a file, then that will will be copied throuh directly. If
// points to a file, then that will will be copied through directly. If
// it points to a directory, then it will copy the directory "rsync
// style" onto the file destination. As a result, if this is a file,
// then the main file res must be a file, and if it is a directory, then
@@ -643,7 +643,7 @@ func (obj *FileRes) fileCheckApply(ctx context.Context, apply bool, src io.ReadS
return "", false, err
}
sha256sum = hex.EncodeToString(hash.Sum(nil))
// since we re-use this src handler below, it is
// since we reuse this src handler below, it is
// *critical* to seek to 0, or we'll copy nothing!
if n, err := src.Seek(0, 0); err != nil || n != 0 {
return sha256sum, false, err
@@ -673,7 +673,7 @@ func (obj *FileRes) fileCheckApply(ctx context.Context, apply bool, src io.ReadS
if err != nil {
return sha256sum, false, err
}
defer dstFile.Close() // TODO: is this redundant because of the earlier defered Close() ?
defer dstFile.Close() // TODO: is this redundant because of the earlier deferred Close() ?
if isFile { // set mode because it's a new file
if err := dstFile.Chmod(srcStat.Mode()); err != nil {

View File

@@ -46,7 +46,7 @@ func init() {
// PanicRes is a no-op resource that does nothing as quietly as possible. One of
// these will be added the graph if you use the panic function. (Even when it is
// in a non-panic mode.) This is possibly the simplest resource that exists, and
// in fact, everytime it is used, it will always have the same "name" value. It
// in fact, every time it is used, it will always have the same "name" value. It
// is only used so that there is a valid destination for the panic function.
type PanicRes struct {
traits.Base // add the base methods without re-implementation

View File

@@ -853,7 +853,7 @@ func (obj *VirtRes) CheckApply(ctx context.Context, apply bool) (bool, error) {
}
// FIXME: is doing this early check (therefore twice total) a good idea?
// run additional pre-emptive attr change checks here for hotplug stuff!
// run additional preemptive attr change checks here for hotplug stuff!
if !obj.absent {
if c, err := obj.attrCheckApply(ctx, apply, dom); err != nil {
return false, errwrap.Wrapf(err, "early attrCheckApply failed")