mirror of
https://github.com/lxc/incus
synced 2026-08-02 05:26:46 +00:00
cmd: Fix spelling errors found by codespell
Signed-off-by: Colin Watson <cjwatson@debian.org>
This commit is contained in:
parent
0b2edc4b3d
commit
13a7e285a2
@ -47,7 +47,7 @@ ensure the file has been cleared of content:
|
||||
|
||||
### Generation Directive Arguments
|
||||
|
||||
The generation directive aruments have the following form:
|
||||
The generation directive arguments have the following form:
|
||||
|
||||
`//generate-database:mapper <command> flags <kind> <args...>`
|
||||
|
||||
|
||||
@ -344,7 +344,7 @@ func parseField(f *types.Var, structTag string, kind string, pkgName string) (*F
|
||||
return nil, fmt.Errorf("Unexported field name %q", name)
|
||||
}
|
||||
|
||||
// Ignore fields that are marked with a tag of `db:"ingore"`
|
||||
// Ignore fields that are marked with a tag of `db:"ignore"`
|
||||
if structTag != "" {
|
||||
tagValue := reflect.StructTag(structTag).Get("db")
|
||||
if tagValue == "ignore" {
|
||||
|
||||
@ -21,7 +21,7 @@ type preparer interface {
|
||||
|
||||
// RegisterStmt register a SQL statement.
|
||||
//
|
||||
// Registered statements will be prepared upfront and re-used, to speed up
|
||||
// Registered statements will be prepared upfront and reused, to speed up
|
||||
// execution.
|
||||
//
|
||||
// Return a unique registration code.
|
||||
|
||||
@ -63,7 +63,7 @@ func (c *cmdDaemon) Run(cmd *cobra.Command, args []string) error {
|
||||
return fmt.Errorf("Failed to obtain connection info: %w", err)
|
||||
}
|
||||
|
||||
// Keep track of the socket path we used to succefully connect to the server
|
||||
// Keep track of the socket path we used to successfully connect to the server
|
||||
serverUnixPath := cinfo.SocketPath
|
||||
|
||||
// Validate the configuration.
|
||||
|
||||
@ -243,7 +243,7 @@ func (c *cmdAdminInit) askClustering(config *api.InitPreseed, d incus.InstanceSe
|
||||
return fmt.Errorf(i18n.G("Failed to setup trust relationship with cluster: %w"), err)
|
||||
}
|
||||
|
||||
// Now we have setup trust, don't send to server, othwerwise it will try and setup trust
|
||||
// Now we have setup trust, don't send to server, otherwise it will try and setup trust
|
||||
// again and if using a one-time join token, will fail.
|
||||
config.Cluster.ClusterToken = ""
|
||||
|
||||
@ -772,7 +772,7 @@ func (c *cmdAdminInit) askDaemon(config *api.InitPreseed, d incus.InstanceServer
|
||||
This means that unless you manually configured your host otherwise,
|
||||
you will not have enough uids and gids to allocate to your containers.
|
||||
|
||||
Your container's own allocation can be re-used to avoid the problem.
|
||||
Your container's own allocation can be reused to avoid the problem.
|
||||
Doing so makes your nested containers slightly less safe as they could
|
||||
in theory attack their parent container and gain more privileges than
|
||||
they otherwise would.`) + "\n\n")
|
||||
|
||||
@ -471,7 +471,7 @@ func (c *cmdCopy) Run(cmd *cobra.Command, args []string) error {
|
||||
keepVolatile := c.flagRefresh
|
||||
instanceOnly := c.flagInstanceOnly
|
||||
|
||||
// If not target name is specified, one will be chosed by the server
|
||||
// If target name is not specified, one will be chosen by the server
|
||||
if len(args) < 2 {
|
||||
return c.copyInstance(conf, args[0], "", keepVolatile, ephem, stateful, instanceOnly, mode, c.flagStorage, false)
|
||||
}
|
||||
|
||||
@ -316,7 +316,7 @@ func (c *cmdMove) moveInstance(sourceResource string, destResource string, state
|
||||
return err
|
||||
}
|
||||
|
||||
// Fetch the current isntance.
|
||||
// Fetch the current instance.
|
||||
inst, _, err := source.GetInstance(sourceName)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@ -518,7 +518,7 @@ Pre-defined column shorthand chars:
|
||||
return cmd
|
||||
}
|
||||
|
||||
const defaultStorageBucketColumns = "nd"
|
||||
const defaultStorageBucketColumns = "nd" // codespell:ignore nd
|
||||
|
||||
func (c *cmdStorageBucketList) parseColumns(clustered bool) ([]storageBucketColumn, error) {
|
||||
columnsShorthandMap := map[rune]storageBucketColumn{
|
||||
|
||||
@ -2160,8 +2160,8 @@ func internalClusterPostAccept(d *Daemon, r *http.Request) response.Response {
|
||||
return response.BadRequest(fmt.Errorf("No name provided"))
|
||||
}
|
||||
|
||||
// Redirect all requests to the leader, which is the one with
|
||||
// knowning what nodes are part of the raft cluster.
|
||||
// Redirect all requests to the leader, which is the one
|
||||
// knowing what nodes are part of the raft cluster.
|
||||
localClusterAddress := s.LocalConfig.ClusterAddress()
|
||||
|
||||
leader, err := s.Cluster.LeaderAddress()
|
||||
|
||||
@ -319,7 +319,7 @@ func internalRecoverScan(ctx context.Context, s *state.State, userPools []api.St
|
||||
|
||||
// Create the pools themselves.
|
||||
for _, pool := range pools {
|
||||
// Create missing storage pool DB record if neeed.
|
||||
// Create missing storage pool DB record if needed.
|
||||
if pool.ID() == storagePools.PoolIDTemporary {
|
||||
var instPoolVol *backupConfig.Config // Instance volume used for new pool record.
|
||||
var poolID int64 // Pool ID of created pool record.
|
||||
|
||||
@ -1578,7 +1578,7 @@ func projectValidateConfig(s *state.State, config map[string]string) error {
|
||||
// gendoc:generate(entity=project, group=restricted, key=restricted.containers.privilege)
|
||||
// Possible values are `unprivileged`, `isolated`, and `allow`.
|
||||
//
|
||||
// - When set to `unpriviliged`, this option prevents setting {config:option}`instance-security:security.privileged` to `true`.
|
||||
// - When set to `unprivileged`, this option prevents setting {config:option}`instance-security:security.privileged` to `true`.
|
||||
// - When set to `isolated`, this option prevents setting {config:option}`instance-security:security.privileged` and {config:option}`instance-security:security.idmap.isolated` to `true`.
|
||||
// - When set to `allow`, there is no restriction.
|
||||
// ---
|
||||
|
||||
@ -1839,7 +1839,7 @@ func (d *Daemon) Stop(ctx context.Context, sig os.Signal) error {
|
||||
if sig == unix.SIGPWR || sig == unix.SIGTERM {
|
||||
if d.db.Cluster != nil {
|
||||
// waitForOperations will block until all operations are done, or it's forced to shut down.
|
||||
// For the latter case, we re-use the shutdown channel which is filled when a shutdown is
|
||||
// For the latter case, we reuse the shutdown channel which is filled when a shutdown is
|
||||
// initiated using `shutdown`.
|
||||
waitForOperations(ctx, d.db.Cluster, s.GlobalConfig.ShutdownTimeout())
|
||||
}
|
||||
|
||||
@ -544,7 +544,7 @@ func ImageDownload(ctx context.Context, r *http.Request, s *state.State, op *ope
|
||||
return nil, false, fmt.Errorf("Unsupported protocol: %v", protocol)
|
||||
}
|
||||
|
||||
// Override visiblity
|
||||
// Override visibility
|
||||
info.Public = args.Public
|
||||
|
||||
// We want to enable auto-update only if we were passed an
|
||||
|
||||
@ -328,9 +328,9 @@ func devIncusAPI(d *Daemon, f hoistFunc) http.Handler {
|
||||
* event, we use SO_PEERCRED to extract the creds for the socket.
|
||||
*
|
||||
* 2. We store a map from the connection pointer to the pid for that
|
||||
* connection, so that once the HTTP negotiation occurrs and we get a
|
||||
* connection, so that once the HTTP negotiation occurs and we get a
|
||||
* ResponseWriter, we know (because we negotiated on the first byte) which
|
||||
* pid the connection belogs to.
|
||||
* pid the connection belongs to.
|
||||
*
|
||||
* 3. Regular HTTP negotiation and dispatch occurs via net/http.
|
||||
*
|
||||
|
||||
@ -672,7 +672,7 @@ func pruneExpiredAndAutoCreateInstanceSnapshotsTask(d *Daemon) (task.Func, task.
|
||||
return
|
||||
}
|
||||
|
||||
// Get list of instances on the local member that are due to have snaphots creating.
|
||||
// Get list of instances on the local member that are due to have snapshots creating.
|
||||
filter := dbCluster.InstanceFilter{Node: &s.ServerName}
|
||||
|
||||
err = s.DB.Cluster.Transaction(ctx, func(ctx context.Context, tx *db.ClusterTx) error {
|
||||
|
||||
@ -15,7 +15,7 @@ import (
|
||||
|
||||
// swagger:operation GET /1.0/instances/{name}/access instances instance_access
|
||||
//
|
||||
// Get who has access to an instnace
|
||||
// Get who has access to an instance
|
||||
//
|
||||
// Gets the access information for the instance.
|
||||
//
|
||||
|
||||
@ -208,7 +208,7 @@ func (suite *containerTestSuite) TestContainer_LoadFromDB() {
|
||||
suite.Exactly(
|
||||
apiC1,
|
||||
apiC2,
|
||||
"The loaded container isn't excactly the same as the created one.",
|
||||
"The loaded container isn't exactly the same as the created one.",
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ func mockStartDaemon() (*Daemon, error) {
|
||||
d := defaultDaemon()
|
||||
d.os.MockMode = true
|
||||
|
||||
// Setup test certificates. We re-use the ones already on disk under
|
||||
// Setup test certificates. We reuse the ones already on disk under
|
||||
// the test/ directory, to avoid generating new ones, which is
|
||||
// expensive.
|
||||
err := sys.SetupTestCerts(internalUtil.VarPath())
|
||||
|
||||
@ -111,7 +111,7 @@ func (c *migrationConn) AcceptIncoming(r *http.Request, w http.ResponseWriter) e
|
||||
}
|
||||
|
||||
// WebSocket returns the underlying websocket connection.
|
||||
// If the connection isn't yet active it will either wait for an incoming connection or if configured, will atempt
|
||||
// If the connection isn't yet active it will either wait for an incoming connection or if configured, will attempt
|
||||
// to initiate a new outbound connection. If the context is cancelled before the connection is established it
|
||||
// will return with an error.
|
||||
func (c *migrationConn) WebSocket(ctx context.Context) (*websocket.Conn, error) {
|
||||
|
||||
@ -42,7 +42,7 @@ import (
|
||||
"github.com/lxc/incus/v6/shared/util"
|
||||
)
|
||||
|
||||
// Lock to prevent concurent networks creation.
|
||||
// Lock to prevent concurrent networks creation.
|
||||
var networkCreateLock sync.Mutex
|
||||
|
||||
var networksCmd = APIEndpoint{
|
||||
@ -1187,7 +1187,7 @@ func networkPost(d *Daemon, r *http.Request) response.Response {
|
||||
// network having already been renamed in the database, which is
|
||||
// a chicken-and-egg problem for cluster notifications (the
|
||||
// serving node should typically do the database job, so the
|
||||
// network is not yet renamed inthe db when the notified node
|
||||
// network is not yet renamed in the db when the notified node
|
||||
// runs network.Start).
|
||||
if s.ServerClustered {
|
||||
return response.BadRequest(fmt.Errorf("Renaming clustered network not supported"))
|
||||
|
||||
@ -107,7 +107,7 @@ func cronSpecIsNow(spec string) (bool, error) {
|
||||
now := time.Now()
|
||||
|
||||
// Truncate the time now back to the start of the minute.
|
||||
// This is neded because the cron scheduler will add a minute to the scheduled time
|
||||
// This is needed because the cron scheduler will add a minute to the scheduled time
|
||||
// and we don't want the next scheduled time to roll over to the next minute and break
|
||||
// the time comparison below.
|
||||
now = now.Truncate(time.Minute)
|
||||
|
||||
@ -24,7 +24,7 @@ import (
|
||||
)
|
||||
|
||||
// Simple cache used to store the activated drivers on this server.
|
||||
// This allows us to avoid querying the database everytime and API call is made.
|
||||
// This allows us to avoid querying the database every time an API call is made.
|
||||
var (
|
||||
storagePoolUsedDriversCacheVal atomic.Value
|
||||
storagePoolSupportedDriversCacheVal atomic.Value
|
||||
|
||||
@ -31,7 +31,7 @@ import (
|
||||
"github.com/lxc/incus/v6/shared/util"
|
||||
)
|
||||
|
||||
// Lock to prevent concurent storage pools creation.
|
||||
// Lock to prevent concurrent storage pools creation.
|
||||
var storagePoolCreateLock sync.Mutex
|
||||
|
||||
var storagePoolsCmd = APIEndpoint{
|
||||
|
||||
@ -359,7 +359,7 @@ func storagePoolVolumesGet(d *Daemon, r *http.Request) response.Response {
|
||||
}
|
||||
|
||||
// The project name used for custom volumes varies based on whether the
|
||||
// project has the featues.storage.volumes feature enabled.
|
||||
// project has the features.storage.volumes feature enabled.
|
||||
customVolProjectName = project.StorageVolumeProjectFromRecord(p, db.StoragePoolVolumeTypeCustom)
|
||||
|
||||
projectImages, err = tx.GetImagesFingerprints(ctx, requestProjectName, false)
|
||||
|
||||
@ -26,7 +26,7 @@ func TestValidateConfig(t *testing.T) {
|
||||
true,
|
||||
},
|
||||
{
|
||||
"container name missmatch (1)",
|
||||
"container name mismatch (1)",
|
||||
[]string{
|
||||
"lxc.uts.name = c2",
|
||||
},
|
||||
@ -34,7 +34,7 @@ func TestValidateConfig(t *testing.T) {
|
||||
true,
|
||||
},
|
||||
{
|
||||
"container name missmatch (2)",
|
||||
"container name mismatch (2)",
|
||||
[]string{
|
||||
"lxc.utsname = c2",
|
||||
},
|
||||
|
||||
@ -92,7 +92,7 @@ func lz4Uncompress(zfilename string) error {
|
||||
|
||||
zinfo, err := zfile.Stat()
|
||||
if err != nil {
|
||||
return fmt.Errorf("Fialed to get file info for %q: %w", zfilename, err)
|
||||
return fmt.Errorf("Failed to get file info for %q: %w", zfilename, err)
|
||||
}
|
||||
|
||||
// use the same mode for the output file
|
||||
|
||||
@ -83,7 +83,7 @@ func (c *cmdMigrate) validate(source source, target target) error {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// Check if any instance is persent.
|
||||
// Check if any instance is present.
|
||||
names, err = srcClient.GetInstanceNames(api.InstanceTypeAny)
|
||||
if err != nil {
|
||||
return false, err
|
||||
|
||||
Loading…
Reference in New Issue
Block a user