Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spelling #2075

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/crane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ and registries.

<img src="../../images/crane.png" width="40%">

A collection of useful things you can do with `crane` is [here](recipes.md).
A collection of useful things you can do with `crane` is [recipes](recipes.md).

## Installation

Expand Down
6 changes: 3 additions & 3 deletions cmd/crane/cmd/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ func catalog(ctx context.Context, w io.Writer, src string, fullRef bool, o crane
return err
}

catalogger, err := puller.Catalogger(ctx, reg)
cataloger, err := puller.Cataloger(ctx, reg)
if err != nil {
return fmt.Errorf("reading tags for %s: %w", reg, err)
}

for catalogger.HasNext() {
repos, err := catalogger.Next(ctx)
for cataloger.HasNext() {
repos, err := cataloger.Next(ctx)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/crane/rebase.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ is `FROM` with a new base image.

![rebase visualization](./rebase.png)

([link](https://docs.google.com/drawings/d/1w8UxTZDRbDWVoqnbr17SJuU73pRxpOmOk_vzmC9WB2k/edit))
([private Google drawing](https://docs.google.com/drawings/d/1w8UxTZDRbDWVoqnbr17SJuU73pRxpOmOk_vzmC9WB2k/edit))

**This is not safe in general**, but it can be extremely useful for platform
providers, e.g. when a vulnerability is discovered in a base layer and many
Expand Down
2 changes: 1 addition & 1 deletion internal/depcheck/depcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (g graph) order() []string {
return order
}

// path constructs an examplary path that looks something like:
// path constructs an example path that looks something like:
//
// knative.dev/pkg/apis/duck
// knative.dev/pkg/apis # Also: [knative.dev/pkg/kmeta knative.dev/pkg/tracker]
Expand Down
2 changes: 1 addition & 1 deletion internal/retry/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
)

// Backoff is an alias of our own wait.Backoff to avoid name conflicts with
// the kubernetes wait package. Typing retry.Backoff is aesier than fixing
// the kubernetes wait package. Typing retry.Backoff is easier than fixing
// the wrong import every time you use wait.Backoff.
type Backoff = wait.Backoff

Expand Down
2 changes: 1 addition & 1 deletion pkg/authn/k8schain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is an implementation of the [`authn.Keychain`](https://godoc.org/github.com

This keychain supports passing a Kubernetes Service Account and some ImagePullSecrets which may represent registry credentials.

In addition to those, the keychain also includes cloud-specific credential helpers for Google Container Registry (and Artifact Registry), Azure Container Registry, and Amazon AWS Elasic Container Registry.
In addition to those, the keychain also includes cloud-specific credential helpers for Google Container Registry (and Artifact Registry), Azure Container Registry, and Amazon AWS Elastic Container Registry.
This means that if the keychain is used from within Kubernetes services on those clouds (GKE, AKS, EKS), any available service credentials will be discovered and used.

In general this keychain should be used when the code is expected to run in a Kubernetes cluster, and especially when it will run in one of those clouds.
Expand Down
2 changes: 1 addition & 1 deletion pkg/authn/kubernetes/keychain.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func NewFromPullSecrets(ctx context.Context, secrets []corev1.Secret) (authn.Key

}

// We reverse sort in to give more specific (aka longer) keys priority
// We reverse sort to give more specific (aka longer) keys priority
// when matching for creds
sort.Sort(sort.Reverse(sort.StringSlice(keyring.index)))
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/authn/kubernetes/keychain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func TestSecretAttachedServiceAccount(t *testing.T) {

}

// Prioritze picking the first secret
// Prioritize picking the first secret
func TestSecretPriority(t *testing.T) {
secrets := []corev1.Secret{
*dockerCfgSecretType.Create(t, "ns", "secret", "fake.registry.io", authn.AuthConfig{
Expand Down
2 changes: 1 addition & 1 deletion pkg/crane/append.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func isWindows(img v1.Image) (bool, error) {
return cfg != nil && cfg.OS == "windows", nil
}

// Append reads a layer from path and appends it the the v1.Image base.
// Append reads a layer from path and appends it the v1.Image base.
//
// If the base image is a Windows base image (i.e., its config.OS is
// "windows"), the contents of the tarballs will be modified to be suitable for
Expand Down
2 changes: 1 addition & 1 deletion pkg/crane/crane_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func TestCraneRegistry(t *testing.T) {
t.Fatalf("wanted 6 tags, got %d", len(tags))
}

// Delete the non existing image
// Delete the nonexistent image
if err := crane.Delete(dst + ":honk-image"); err == nil {
t.Fatal("wanted err, got nil")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/legacy/tarball/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
[![GoDoc](https://godoc.org/github.com/google/go-containerregistry/pkg/legacy/tarball?status.svg)](https://godoc.org/github.com/google/go-containerregistry/pkg/legacy/tarball)

This package implements support for writing legacy tarballs, as described
[here](https://github.com/moby/moby/blob/749d90e10f989802638ae542daf54257f3bf71f2/image/spec/v1.2.md#combined-image-json--filesystem-changeset-format).
in [Combined Image JSON + Filesystem Changeset Format](https://github.com/moby/moby/blob/749d90e10f989802638ae542daf54257f3bf71f2/image/spec/v1.2.md#combined-image-json--filesystem-changeset-format).
2 changes: 1 addition & 1 deletion pkg/name/ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type Reference interface {
// Identifier accesses the type-specific portion of the reference.
Identifier() string

// Name is the fully-qualified reference name.
// Name is the fully qualified reference name.
Name() string

// Scope is the scope needed to access this reference.
Expand Down
8 changes: 4 additions & 4 deletions pkg/registry/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ func TestCalls(t *testing.T) {
Header: map[string]string{"Docker-Distribution-API-Version": "registry/2.0"},
},
{
Description: "GET non existent blob",
Description: "GET nonexistent blob",
Method: "GET",
URL: "/v2/foo/blobs/sha256:2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae",
Code: http.StatusNotFound,
},
{
Description: "HEAD non existent blob",
Description: "HEAD nonexistent blob",
Method: "HEAD",
URL: "/v2/foo/blobs/sha256:2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae",
Code: http.StatusNotFound,
Expand Down Expand Up @@ -461,7 +461,7 @@ func TestCalls(t *testing.T) {
Want: `{"name":"foo","tags":["tag1"]}`,
},
{
Description: "list non existing tags",
Description: "list nonexistent tags",
Method: "GET",
URL: "/v2/foo/tags/list?n=1000",
Code: http.StatusNotFound,
Expand Down Expand Up @@ -493,7 +493,7 @@ func TestCalls(t *testing.T) {
Code: http.StatusOK,
Manifests: map[string]string{
"foo/manifests/image": "foo",
"foo/manifests/points-to-image": "{\"subject\": {\"digest\": \"sha256:" + sha256String("nonexistant") + "\"}}",
"foo/manifests/points-to-image": "{\"subject\": {\"digest\": \"sha256:" + sha256String("nonexistent") + "\"}}",
},
Header: map[string]string{
"Content-Type": "application/vnd.oci.image.index.v1+json",
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/google/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ type gcloudSource struct {
exec func(ctx context.Context) *exec.Cmd
}

// Token implements oauath2.TokenSource.
// Token implements oauth2.TokenSource.
func (gs gcloudSource) Token() (*oauth2.Token, error) {
cmd := gs.exec(gs.ctx)
var out bytes.Buffer
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/google/testdata/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# testdata

This key is cribbed from [here](https://github.com/golang/oauth2/blob/d668ce993890a79bda886613ee587a69dd5da7a6/google/testdata/gcloud/credentials).
This key is cribbed from [google/testdata/gcloud/credentials](https://github.com/golang/oauth2/blob/d668ce993890a79bda886613ee587a69dd5da7a6/google/testdata/gcloud/credentials).
It's invalid but parses sufficiently to test `NewEnvAuthenticator`.
2 changes: 1 addition & 1 deletion pkg/v1/layout/write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func TestAppendDescriptorInitializesIndex(t *testing.T) {
t.Fatal(err)
}

// Append a descriptor to a non-existent layout.
// Append a descriptor to a nonexistent layout.
desc := v1.Descriptor{
Digest: bogusDigest,
Size: 1337,
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/mutate/rebase.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func createAddendums(startHistory, startLayer int, history []v1.History, layers
})
}
}
// In the event history was malformed or non-existent, append the remaining layers.
// In the event history was malformed or nonexistent, append the remaining layers.
for i := layerIndex; i < len(layers); i++ {
if i >= startLayer {
adds = append(adds, Addendum{Layer: layers[layerIndex]})
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/partial/compressed.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (cle *compressedLayerExtender) Uncompressed() (io.ReadCloser, error) {
return nil, err
}

// Often, the "compressed" bytes are not actually-compressed.
// Often, the "compressed" bytes are not actually compressed.
// Peek at the first two bytes to determine whether it's correct to
// wrap this with gzip.UnzipReadCloser or zstd.UnzipReadCloser.
cp, pr, err := compression.PeekCompression(rc)
Expand Down
6 changes: 3 additions & 3 deletions pkg/v1/partial/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ func TestFindIndexes(t *testing.T) {
// just see if it finds all of the indexes
matcher := func(v1.Descriptor) bool { return true }
index := mutate.AppendManifests(base, adds...)
idxes, err := partial.FindIndexes(index, matcher)
indexes, err := partial.FindIndexes(index, matcher)
switch {
case err != nil:
t.Error("unexpected error:", err)
case len(idxes) != indexCount:
t.Errorf("failed on index, actual %d, expected %d", len(idxes), indexCount)
case len(indexes) != indexCount:
t.Errorf("failed on index, actual %d, expected %d", len(indexes), indexCount)
}
}
4 changes: 2 additions & 2 deletions pkg/v1/remote/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ There are a lot of confusingly similar terms that come up when talking about ima
In general...

* A tag refers to an image manifest.
* An image manifest references a config file and an orderered list of _compressed_ layers by sha256 digest.
* An image manifest references a config file and an ordered list of _compressed_ layers by sha256 digest.
* A config file references an ordered list of _uncompressed_ layers by sha256 digest and contains runtime configuration.
* The sha256 digest of the config file is the [image id](https://github.com/opencontainers/image-spec/blob/master/config.md#imageid) for the image.

Expand Down Expand Up @@ -114,4 +114,4 @@ however, it's possible to do _something_ useful with them via [`remote.Get`](htt
which doesn't try to interpret what is returned by the registry.

[`crane.Copy`](https://godoc.org/github.com/google/go-containerregistry/pkg/crane#Copy) takes advantage of this to implement support for copying schema 1 images,
see [here](https://github.com/google/go-containerregistry/blob/main/pkg/internal/legacy/copy.go).
see [legacy/copy.go](https://github.com/google/go-containerregistry/blob/ba53fa10e72c7373ef8068e21c9f102f0c20a940/pkg/internal/legacy/copy.go).
6 changes: 3 additions & 3 deletions pkg/v1/remote/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (f *fetcher) catalogPage(ctx context.Context, reg name.Registry, next strin
return &parsed, nil
}

type Catalogger struct {
type Cataloger struct {
f *fetcher
reg name.Registry
pageSize int
Expand All @@ -145,7 +145,7 @@ type Catalogger struct {
needMore bool
}

func (l *Catalogger) Next(ctx context.Context) (*Catalogs, error) {
func (l *Cataloger) Next(ctx context.Context) (*Catalogs, error) {
if l.needMore {
l.page, l.err = l.f.catalogPage(ctx, l.reg, l.page.Next, l.pageSize)
} else {
Expand All @@ -154,6 +154,6 @@ func (l *Catalogger) Next(ctx context.Context) (*Catalogs, error) {
return l.page, l.err
}

func (l *Catalogger) HasNext() bool {
func (l *Cataloger) HasNext() bool {
return l.page != nil && (!l.needMore || l.page.Next != "")
}
2 changes: 1 addition & 1 deletion pkg/v1/remote/check_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestCheckPushPermission_Real(t *testing.T) {
name.MustParseReference("ubuntu"),
name.MustParseReference("google/cloud-sdk"),
name.MustParseReference("microsoft/dotnet:sdk"),
name.MustParseReference("gcr.io/non-existent-project/made-up"),
name.MustParseReference("gcr.io/nonexistent-project/made-up"),
name.MustParseReference("gcr.io/google-containers/foo"),
name.MustParseReference("quay.io/username/reponame"),
} {
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/remote/descriptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ type errTransport struct{}
func (errTransport) RoundTrip(req *http.Request) (*http.Response, error) {
// This simulates a registry that returns a redirect upon the first
// request, and then returns an error upon subsequent requests. This helps
// test whether error redaction takes into account URLs in error messasges
// test whether error redaction takes into account URLs in error messages
// that are not the original request URL.
if req.URL.Host == "original.com" {
return &http.Response{
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/remote/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ func TestPullingManifestList(t *testing.T) {
}

if diff := cmp.Diff(*desc.Platform, fakePlatform); diff != "" {
t.Errorf("Desciptor() (-want +got) = %v", diff)
t.Errorf("Descriptor() (-want +got) = %v", diff)
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/remote/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ func TestMatchesPlatform(t *testing.T) {
},
want: false,
},
{ // OS must exactly match, and is case sensative. matchesPlatform expected to return false.
{ // OS must exactly match, and is case-sensitive. matchesPlatform expected to return false.
given: v1.Platform{
Architecture: "arm",
OS: "linux",
Expand Down
4 changes: 2 additions & 2 deletions pkg/v1/remote/multi_write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func TestMultiWrite(t *testing.T) {
}
}

// Check that tagged manfest list is present and valid.
// Check that tagged manifest list is present and valid.
got, err := Index(tag3)
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -352,7 +352,7 @@ func TestMultiWrite_Deep(t *testing.T) {
t.Error("Write:", err)
}

// Check that tagged manfest list is present and valid.
// Check that tagged manifest list is present and valid.
got, err := Index(tag)
if err != nil {
t.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/remote/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func WithFilter(key string, value string) Option {
// when possible and avoid sending redundant HEAD requests.
//
// Reuse will take precedence over other options passed to most remote functions because
// most options deal with setting up auth and transports, which Reuse intetionally skips.
// most options deal with setting up auth and transports, which Reuse intentionally skips.
func Reuse[I *Puller | *Pusher](i I) Option {
return func(o *options) error {
if puller, ok := any(i).(*Puller); ok {
Expand Down
16 changes: 8 additions & 8 deletions pkg/v1/remote/puller.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@ func (p *Puller) Catalog(ctx context.Context, reg name.Registry) ([]string, erro
}

func (p *Puller) catalog(ctx context.Context, reg name.Registry, pageSize int) ([]string, error) {
catalogger, err := p.catalogger(ctx, reg, pageSize)
cataloger, err := p.cataloger(ctx, reg, pageSize)
if err != nil {
return nil, err
}
repoList := []string{}
for catalogger.HasNext() {
repos, err := catalogger.Next(ctx)
for cataloger.HasNext() {
repos, err := cataloger.Next(ctx)
if err != nil {
return nil, err
}
Expand All @@ -190,12 +190,12 @@ func (p *Puller) catalog(ctx context.Context, reg name.Registry, pageSize int) (
return repoList, nil
}

// Catalogger lists repos in a registry and returns a Catalogger for paginating through the results.
func (p *Puller) Catalogger(ctx context.Context, reg name.Registry) (*Catalogger, error) {
return p.catalogger(ctx, reg, p.o.pageSize)
// Cataloger lists repos in a registry and returns a Cataloger for paginating through the results.
func (p *Puller) Cataloger(ctx context.Context, reg name.Registry) (*Cataloger, error) {
return p.cataloger(ctx, reg, p.o.pageSize)
}

func (p *Puller) catalogger(ctx context.Context, reg name.Registry, pageSize int) (*Catalogger, error) {
func (p *Puller) cataloger(ctx context.Context, reg name.Registry, pageSize int) (*Cataloger, error) {
f, err := p.fetcher(ctx, reg)
if err != nil {
return nil, err
Expand All @@ -204,7 +204,7 @@ func (p *Puller) catalogger(ctx context.Context, reg name.Registry, pageSize int
if err != nil {
return nil, err
}
return &Catalogger{
return &Cataloger{
f: f,
reg: reg,
pageSize: pageSize,
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/remote/pusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func (rw *repoWriter) writeManifest(ctx context.Context, ref name.Reference, t T
}

// For tags, we want to do this check outside of our Work.Do closure because
// we don't want to dedupe based on the manifest digest.
// we don't want to dedup based on the manifest digest.
_, byTag := ref.(name.Tag)
if byTag {
if exists, err := rw.manifestExists(ctx, ref, t); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/remote/referrers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func TestReferrers(t *testing.T) {
t.Fatalf("referrers diff after second push (-want,+got): %s", d)
}

// Try applying filters and verify number of manifests and and annotations
// Try applying filters and verify number of manifests and annotations
index, err = remote.Referrers(rootRefDigest,
remote.WithFilter("artifactType", "application/testing123"))
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/remote/transport/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Similar reasons! That ends up pulling in grpc, protobuf, and logrus.

> Well... what about [`containers/image`](https://godoc.org/github.com/containers/image/docker)?

That just uses the the `docker/distribution` client... and more!
That just uses the `docker/distribution` client... and more!

![containers/image](../../../../images/containers.dot.svg)

Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/remote/transport/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func NewWithContext(ctx context.Context, reg name.Registry, auth authn.Authentic
// 2a. If we get back a 200, then simply use "t".
//
// 2b. If we get back a 401 with a Basic challenge, then use a transport
// that just attachs auth each roundtrip.
// that just attaches auth each roundtrip.
//
// 2c. If we get back a 401 with a Bearer challenge, then use a transport
// that attaches a bearer token to each request, and refreshes is on 401s.
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/remote/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (w *writer) maybeUpdateScopes(ctx context.Context, ml *MountableLayer) erro
return nil
}

// nextLocation extracts the fully-qualified URL to which we should send the next request in an upload sequence.
// nextLocation extracts the fully qualified URL to which we should send the next request in an upload sequence.
func (w *writer) nextLocation(resp *http.Response) (string, error) {
loc := resp.Header.Get("Location")
if len(loc) == 0 {
Expand Down
Loading