Skip to content

Commit

Permalink
Merge pull request #2116 from rhatdan/codespell
Browse files Browse the repository at this point in the history
Run codespell on code
  • Loading branch information
mtrmac authored Sep 14, 2023
2 parents 5d9bfa2 + 2d2818f commit a92053a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/containers-policy.json.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Finally, two full-store specifiers matching all images in the store are valid sc
- `[`_graph-root_`]`

Note that some tools like Podman and Buildah hard-code overrides of the signature verification policy for “push” operations,
allowing these oprations regardless of configuration in `policy.json`.
allowing these operations regardless of configuration in `policy.json`.

### `dir:`

Expand Down Expand Up @@ -165,7 +165,7 @@ The _reference_ annotation value, if any, is not used.
Supported scopes have the form _repo-path_`:`_image-scope_; _repo_path_ is the path to the OSTree repository.

_image-scope_ is the _docker_reference_ part of the reference, with with a `:latest` tag implied if no tag is present,
and parent namespaces of the _docker_reference_ value (by omitting the tag, or a prefix speciyfing a higher-level namespace).
and parent namespaces of the _docker_reference_ value (by omitting the tag, or a prefix specifying a higher-level namespace).

*Note:*
- The _repo_path_ must be absolute and contain no symlinks. Paths violating these requirements may be silently ignored.
Expand Down
2 changes: 1 addition & 1 deletion internal/image/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (m *manifestOCI1) prepareLayerDecryptEditsIfNecessary(options *types.Manife
return nil, fmt.Errorf("preparing to decrypt before conversion: %d layers vs. %d layer edits", len(originalInfos), len(options.LayerInfos))
}

res := slices.Clone(originalInfos) // Start with a full copy so that we don't forget to copy anything: use the current data in full unless we intentionaly deviate.
res := slices.Clone(originalInfos) // Start with a full copy so that we don't forget to copy anything: use the current data in full unless we intentionally deviate.
updatedEdits := slices.Clone(options.LayerInfos)
for i, info := range options.LayerInfos {
if info.CryptoOperation == types.Decrypt {
Expand Down
2 changes: 1 addition & 1 deletion internal/manifest/oci_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (ic instanceCandidate) isPreferredOver(other *instanceCandidate, preferGzip
case ic.manifestPosition != other.manifestPosition:
return ic.manifestPosition < other.manifestPosition
}
panic("internal error: invalid comparision between two candidates") // This should not be reachable because in all calls we make, the two candidates differ at least in manifestPosition.
panic("internal error: invalid comparison between two candidates") // This should not be reachable because in all calls we make, the two candidates differ at least in manifestPosition.
}

// chooseInstance is a private equivalent to ChooseInstanceByCompression,
Expand Down
4 changes: 2 additions & 2 deletions internal/manifest/oci_index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func TestOCI1EditInstances(t *testing.T) {
list, err = ListFromBlob(validManifest, GuessMIMEType(validManifest))
require.NoError(t, err)

// Verfiy correct zstd sorting
// Verify correct zstd sorting
editInstances = []ListEdit{}
annotations := map[string]string{"io.github.containers.compression.zstd": "true"}
// without zstd
Expand Down Expand Up @@ -215,7 +215,7 @@ func TestOCI1IndexChooseInstanceByCompression(t *testing.T) {
},
{
listFile: "oci1.index.zstd-selection2.json",
// out of list where first instance is gzip , select the first occurance of zstd out of many
// out of list where first instance is gzip , select the first occurrence of zstd out of many
matchedInstances: []expectedMatch{
{"amd64", "", "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", false},
{"amd64", "", "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", true},
Expand Down
6 changes: 3 additions & 3 deletions pkg/blobinfocache/sqlite/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type cache struct {

// The database/sql package says “It is rarely necessary to close a DB.”, and steers towards a long-term *sql.DB connection pool.
// That’s probably very applicable for database-backed services, where the database is the primary data store. That’s not necessarily
// the case for callers of c/image, where image operations might be a small proportion of hte total runtime, and the cache is fairly
// the case for callers of c/image, where image operations might be a small proportion of the total runtime, and the cache is fairly
// incidental even to the image operations. It’s also hard for us to use that model, because the public BlobInfoCache object doesn’t have
// a Close method, so creating a lot of single-use caches could leak data.
//
Expand Down Expand Up @@ -171,7 +171,7 @@ func transaction[T any](sqc *cache, fn func(tx *sql.Tx) (T, error)) (T, error) {

// dbTransaction calls fn within a read-write transaction in db.
func dbTransaction[T any](db *sql.DB, fn func(tx *sql.Tx) (T, error)) (T, error) {
// Ideally we should be able to distinguish between read-only and read-write transctions, see the _txlock=exclusive dicussion.
// Ideally we should be able to distinguish between read-only and read-write transactions, see the _txlock=exclusive dicussion.

var zeroRes T // A zero value of T

Expand Down Expand Up @@ -249,7 +249,7 @@ func ensureDBHasCurrentSchema(db *sql.DB) error {
// * Joins (the two that exist in appendReplacementCandidates) are based on the text representation of digests.
//
// Using integer primary keys might make the joins themselves a bit more efficient, but then we would need to involve an extra
// join to translate from/to the user-provided digests anyway. If anything, that extra join (potentialy more btree lookups)
// join to translate from/to the user-provided digests anyway. If anything, that extra join (potentially more btree lookups)
// is probably costlier than comparing a few more bytes of data.
//
// Perhaps more importantly, storing digest texts directly makes the database dumps much easier to read for humans without
Expand Down

0 comments on commit a92053a

Please sign in to comment.