Skip to content

Commit

Permalink
chore: fix codespell findings (#1210)
Browse files Browse the repository at this point in the history
fixes parts of the findings of
#1206
  • Loading branch information
hilmarf authored Jan 8, 2025
1 parent 4516eae commit 329ee5c
Show file tree
Hide file tree
Showing 109 changed files with 188 additions and 188 deletions.
2 changes: 1 addition & 1 deletion api/config/internal/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type Context interface {
ApplyConfigSet(name string) error

// Reset all configs applied so far, subsequent calls to ApplyTo will
// ony see configs allpied after the last reset.
// only see configs applied after the last reset.
Reset() int64
// Generation return the actual config generation.
// this is a strictly increasing number, regardless of the number
Expand Down
4 changes: 2 additions & 2 deletions api/credentials/config/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ func init() {
// Config describes a configuration for the config context.
type Config struct {
runtime.ObjectVersionedType `json:",inline"`
// Consumers describe predefine logical cosumer specs mapped to credentials
// Consumers describe predefine logical consumer specs mapped to credentials
// These will (potentially) be evaluated if access objects requiring credentials
// are provided by other modules (e.g. oci repo access) without
// specifying crednentials. Then this module can request credentials here by passing
// specifying credentials. Then this module can request credentials here by passing
// an appropriate consumer spec.
Consumers []ConsumerSpec `json:"consumers,omitempty"`
// Repositories describe preloaded credential repositories with potential credential chain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type Config struct {

type CredentialsSpec struct {
CredentialsName string `json:"credentialsName"`
// Reference refers to credentials store in some othe repo
// Reference refers to credentials store in some other repo
Reference *cpi.GenericCredentialsSpec `json:"reference,omitempty"`
// Credentials are direct credentials (one of Reference or Credentials must be set)
Credentials common.Properties `json:"credentials"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ var _ = Describe("vault config", func() {
Expect(err).To(BeNil())
})

It("authenticate with approle with unsufficient authorizations and fail to retrieve credentials", func() {
It("authenticate with approle with insufficient authorizations and fail to retrieve credentials", func() {
SetUpVaultAccess(ctx, DefaultContext, vaultClient, VAULT_INSUFFICIENT_POLICY_RULE)

_ = Must(vaultClient.Secrets.KvV2Write(ctx, VAULT_PATH_REPO1+"/"+VAULT_SECRET, schema.KvV2WriteRequest{
Expand Down Expand Up @@ -169,7 +169,7 @@ var _ = Describe("vault config", func() {
vault.WithMountPath("secret"),
))

// This is how we restrict the secrets accessible through the respository
// This is how we restrict the secrets accessible through the repository
spec.Secrets = append(spec.Secrets, VAULT_SECRET)
repo := Must(DefaultContext.RepositoryForSpec(spec, nil))
Expect(repo).ToNot(BeNil())
Expand Down Expand Up @@ -218,7 +218,7 @@ var _ = Describe("vault config", func() {
vault.WithMountPath("secret"),
))

// This is how we restrict the secrets accessible through the respository
// This is how we restrict the secrets accessible through the repository
spec.Secrets = append(spec.Secrets, VAULT_CUSTOM_SECRETS)
repo := Must(DefaultContext.RepositoryForSpec(spec, nil))
Expect(repo).ToNot(BeNil())
Expand Down
2 changes: 1 addition & 1 deletion api/credentials/internal/credentialsspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (s *DefaultCredentialsSpec) UnmarshalJSON(data []byte) error {
}{}
err = json.Unmarshal(data, specdata)
if err != nil {
return fmt.Errorf("failed ot unmarshal spec data: %w", err)
return fmt.Errorf("failed to unmarshal spec data: %w", err)
}

s.RepositorySpec = repo
Expand Down
2 changes: 1 addition & 1 deletion api/datacontext/action/handlers/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (r *registry) Get(spec api.ActionSpec, possible ...string) []ActionHandlerM
var result []ActionHandlerMatch

if kinds := r.registrations[spec.GetKind()]; kinds != nil {
// first, check direct selctor match
// first, check direct selector match
if reg := kinds[spec.Selector()]; reg != nil {
if len(reg.versions) != 0 {
if v := MatchVersion(r.types.SupportedActionVersions(spec.GetKind()), reg.versions); v != "" {
Expand Down
2 changes: 1 addition & 1 deletion api/datacontext/config/attrs/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func init() {
// Config describes a memory based repository interface.
type Config struct {
runtime.ObjectVersionedType `json:",inline"`
// Attributes descibe a set of geeric attribute settings
// Attributes describe a set of generic attribute settings
Attributes map[string]json.RawMessage `json:"attributes,omitempty"`
}

Expand Down
2 changes: 1 addition & 1 deletion api/datacontext/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ type AttributesContext interface {
BindTo(ctx context.Context) context.Context
}

// AttributeFactory is used to atomicly create a new attribute for a context.
// AttributeFactory is used to atomically create a new attribute for a context.
type AttributeFactory func(Context) interface{}

type Attributes interface {
Expand Down
8 changes: 4 additions & 4 deletions api/helper/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type Option interface {
// This indirection (Option -> OptionHandler) is introduced
// to enable objects to be usable as env option
// (for example Environment) without the need to pollute its
// interface with the effective option methods defiuned by
// interface with the effective option methods defined by
// OptionHandler. This would make no sense, because an option
// typically does nothing but for a selected set of methods
// according to its intended functionality. Nevertheless,
Expand All @@ -55,7 +55,7 @@ type OptionHandler interface {
GetFailHandler() FailHandler
GetEnvironment() *Environment

// actions on environment ot properties
// actions on environment of properties

// Mount mounts a new filesystem to the actual env filesystem.
Mount(fs *composefs.ComposedFileSystem) error
Expand Down Expand Up @@ -283,7 +283,7 @@ func (o tdOpt) OptionHandler() OptionHandler {
func (o tdOpt) Mount(cfs *composefs.ComposedFileSystem) error {
fs, err := projectionfs.New(osfs.New(), o.source)
if err != nil {
return fmt.Errorf("faild to create new project fs: %w", err)
return fmt.Errorf("failed to create new project fs: %w", err)
}

if o.modifiable {
Expand All @@ -297,7 +297,7 @@ func (o tdOpt) Mount(cfs *composefs.ComposedFileSystem) error {
}

if err := cfs.Mount(o.path, fs); err != nil {
return fmt.Errorf("faild to mount cfs: %w", err)
return fmt.Errorf("failed to mount cfs: %w", err)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion api/oci/extensions/repositories/ctf/synthesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ var _ = Describe("syntheses", func() {
MustBeSuccessful(nested.Finalize())
Expect(vfs.Exists(info.FileSystem(), path)).To(BeFalse())

// use syntesized blob to extract new blob, useless but should work
// use synthesized blob to extract new blob, useless but should work
newblob := Must(artifactset.SynthesizeArtifactBlob(set, TAG))
finalize.Close(newblob, "newblob")

Expand Down
2 changes: 1 addition & 1 deletion api/ocm/compdesc/accessors.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type ArtifactAccessor interface {
}

// AccessSpec is an abstract specification of an access method
// The outbound object is typicall a runtime.UnstructuredTypedObject.
// The outbound object is typically a runtime.UnstructuredTypedObject.
// Inbound any serializable AccessSpec implementation is possible.
type AccessSpec = accessors.AccessSpec

Expand Down
2 changes: 1 addition & 1 deletion api/ocm/compdesc/componentdescriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ type ElementMeta struct {
// Version is the semver version of the object.
Version string `json:"version"`
// ExtraIdentity is the identity of an object.
// An additional label with key "name" ist not allowed
// An additional label with key "name" is not allowed
ExtraIdentity metav1.Identity `json:"extraIdentity,omitempty"`
// Labels defines an optional set of additional labels
// describing the object.
Expand Down
2 changes: 1 addition & 1 deletion api/ocm/compdesc/copy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"ocm.software/ocm/api/utils/runtime"
)

var _ = Describe("Component Descripor Copy Test Suitet", func() {
var _ = Describe("Component Descriptor Copy Test Suitet", func() {
Context("compdesc copy", func() {
It("copies CD", func() {
labels := v1.Labels{
Expand Down
2 changes: 1 addition & 1 deletion api/ocm/compdesc/equal.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (cd *ComponentDescriptor) Equivalent(o *ComponentDescriptor) equivalent.Equ
func EquivalentElems(a ElementListAccessor, b ElementListAccessor) equivalent.EqualState {
state := equivalent.StateEquivalent()

// Equivaluent of elements handles nil to provide state accoding to it
// Equivalent of elements handles nil to provide state according to it
// relevance for the signature.
for i := 0; i < a.Len(); i++ {
ea := a.Get(i)
Expand Down
2 changes: 1 addition & 1 deletion api/ocm/compdesc/normalizations/legacy/legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var (

// DefaultingOfVersionIntoExtraIdentity normalizes the extra identity of the resources.
// It sets the version of the resource, reference or source as extra identity field if the combination of name+extra identity
// is the same for multiple items. However, the last item in the list will not be updated as it is unique wihout this.
// is the same for multiple items. However, the last item in the list will not be updated as it is unique without this.
//
// TODO: To be removed once v1 + v2 are removed.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ type ElementMeta struct {
// Version is the semver version of the object.
Version string `json:"version"`
// ExtraIdentity is the identity of an object.
// An additional label with key "name" ist not allowed
// An additional label with key "name" is not allowed
ExtraIdentity metav1.Identity `json:"extraIdentity,omitempty"`
// Labels defines an optional set of additional labels
// describing the object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ var _ = Describe("Validation", func() {
}))))
})

It("should pass if labels are defined multiple times in the same context with differnet names", func() {
It("should pass if labels are defined multiple times in the same context with different names", func() {
comp.Spec.References = []Reference{
{
ElementMeta: ElementMeta{
Expand Down
2 changes: 1 addition & 1 deletion api/ocm/compdesc/versions/v2/componentdescriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ type ElementMeta struct {
// Version is the semver version of the object.
Version string `json:"version"`
// ExtraIdentity is the identity of an object.
// An additional label with key "name" ist not allowed
// An additional label with key "name" is not allowed
ExtraIdentity metav1.Identity `json:"extraIdentity,omitempty"`
// Labels defines an optional set of additional labels
// describing the object.
Expand Down
2 changes: 1 addition & 1 deletion api/ocm/compdesc/versions/v2/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ var _ = Describe("Validation", func() {
}))))
})

It("should pass if labels are defined multiple times in the same context with differnet names", func() {
It("should pass if labels are defined multiple times in the same context with different names", func() {
comp.ComponentReferences = []ComponentReference{
{
ElementMeta: ElementMeta{
Expand Down
2 changes: 1 addition & 1 deletion api/ocm/cpi/repocpi/view_cv.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type ComponentVersionAccessBridge interface {
// and update mode state
ShouldUpdate(final bool) bool

// GetBlobCache retieves the blob cache used to store preliminary
// GetBlobCache retrieves the blob cache used to store preliminary
// blob accesses for freshly generated local access specs not directly
// usable until a component version is finally added to the repository.
GetBlobCache() BlobCache
Expand Down
2 changes: 1 addition & 1 deletion api/ocm/extensions/accessmethods/compose/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type AccessSpec struct {
GlobalAccess *accspeccpi.AccessSpecRef `json:"globalAccess,omitempty"`
// ReferenceName is an optional static name the object should be
// use in a local repository context. It is use by a repository
// to optionally determine a globally referencable access according
// to optionally determine a globally referenceable access according
// to the OCI distribution spec. The result will be stored
// by the repository in the field ImageReference.
// The value is typically an OCI repository name optionally
Expand Down
2 changes: 1 addition & 1 deletion api/ocm/extensions/accessmethods/github/method_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ var _ = Describe("Method", func() {
vfs.Cleanup(fs)
})

It("provides comsumer id", func() {
It("provides consumer id", func() {
m, err := accessSpec.AccessMethod(&cpi.DummyComponentVersionAccess{Context: ctx})
Expect(err).ToNot(HaveOccurred())
Expect(credentials.GetProvidedConsumerId(m)).To(Equal(credentials.NewConsumerIdentity(identity.CONSUMER_TYPE,
Expand Down
6 changes: 3 additions & 3 deletions api/ocm/extensions/accessmethods/localblob/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (
// this package shows how to implement access types with multiple serialization versions.
// So far, only one is implemented, but it shows how to add other ones.
//
// Specifications using multiple format versions allways provide a single common
// Specifications using multiple format versions always provide a single common
// *internal* Go representation, intended to be used by library users. Only this
// internal version should be used outside this package. Additionally, there
// are Go types representing the various format versions, which will be used
Expand Down Expand Up @@ -91,7 +91,7 @@ type AccessSpec struct {
GlobalAccess *accspeccpi.AccessSpecRef `json:"globalAccess,omitempty"`
// ReferenceName is an optional static name the object should be
// use in a local repository context. It is use by a repository
// to optionally determine a globally referencable access according
// to optionally determine a globally referenceable access according
// to the OCI distribution spec. The result will be stored
// by the repository in the field ImageReference.
// The value is typically an OCI repository name optionally
Expand Down Expand Up @@ -157,7 +157,7 @@ type AccessSpecV1 struct {
GlobalAccess *accspeccpi.AccessSpecRef `json:"globalAccess,omitempty"`
// ReferenceName is an optional static name the object should be
// use in a local repository context. It is use by a repository
// to optionally determine a globally referencable access according
// to optionally determine a globally referenceable access according
// to the OCI distribution spec. The result will be stored
// by the repository in the field ImageReference.
// The value is typically an OCI repository name optionally
Expand Down
4 changes: 2 additions & 2 deletions api/ocm/extensions/accessmethods/ocm/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ var _ = Describe("OCM access CLI Test Environment", func() {
Expect(h).NotTo(BeNil())
Expect(h.GetName()).To(Equal(ocm.Type))

ot := h.OptionTypes()
Expect(len(ot)).To(Equal(4))
optionTypes := h.OptionTypes()
Expect(len(optionTypes)).To(Equal(4))

opts := h.CreateOptions()
Expect(sliceutils.Transform(opts.Options(), transformer.GetName[flagsets.Option, string])).To(ConsistOf(
Expand Down
4 changes: 2 additions & 2 deletions api/ocm/extensions/accessmethods/options/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type option struct {
}

func (o *option) Equal(t flagsets.ConfigOptionType) bool {
if ot, ok := t.(*option); ok {
return o.valueType == ot.valueType && o.GetName() == ot.GetName()
if optionType, ok := t.(*option); ok {
return o.valueType == optionType.valueType && o.GetName() == optionType.GetName()
}
return false
}
Expand Down
4 changes: 2 additions & 2 deletions api/ocm/extensions/accessmethods/plugin/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ var _ = Describe("Add with new access method", func() {
Expect(h).NotTo(BeNil())
Expect(h.GetName()).To(Equal("test"))

ot := h.OptionTypes()
Expect(len(ot)).To(Equal(2))
optionTypes := h.OptionTypes()
Expect(len(optionTypes)).To(Equal(2))

opts := h.CreateOptions()
Expect(sliceutils.Transform(opts.Options(), transformer.GetName[flagsets.Option, string])).To(ConsistOf(
Expand Down
2 changes: 1 addition & 1 deletion api/ocm/extensions/accessmethods/s3/method_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ var _ = Describe("Method", func() {
vfs.Cleanup(fs)
})

It("provides comsumer id", func() {
It("provides consumer id", func() {
m, err := accessSpec.AccessMethod(&cpi.DummyComponentVersionAccess{Context: env.OCMContext()})
Expect(err).ToNot(HaveOccurred())
Expect(credentials.GetProvidedConsumerId(m)).To(Equal(credentials.NewConsumerIdentity(identity.CONSUMER_TYPE,
Expand Down
2 changes: 1 addition & 1 deletion api/ocm/extensions/blobhandler/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
// implementations of the oci go binding interface
// In those sub packages there a handler packages for dedicated repository
// implementations for this type, for example the oci registry implementation
// for the contect type oci.
// for the connect type oci.
package blobhandler
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var _ = Describe("blobhandler generic maven tests", func() {
"path" : "/open-component-model/hello-ocm/0.0.2/hello-ocm-0.0.2.jar",
"created" : "2024-04-11T15:09:28.920Z",
"createdBy" : "john.doe",
"downloadUri" : "https://ocm.sofware/repository/ocm-mvn-test/open-component-model/hello-ocm/0.0.2/hello-ocm-0.0.2.jar",
"downloadUri" : "https://ocm.software/repository/ocm-mvn-test/open-component-model/hello-ocm/0.0.2/hello-ocm-0.0.2.jar",
"mimeType" : "application/java-archive",
"size" : "1792",
"checksums" : {
Expand All @@ -50,13 +50,13 @@ var _ = Describe("blobhandler generic maven tests", func() {
"sha256" : "b19dcd275f72a0cbdead1e5abacb0ef25a0cb55ff36252ef44b1178eeedf9c30" },
"originalChecksums" : {
"sha256" : "b19dcd275f72a0cbdead1e5abacb0ef25a0cb55ff36252ef44b1178eeedf9c30" },
"uri" : "https://ocm.sofware/repository/ocm-mvn-test/open-component-model/hello-ocm/0.0.2/hello-ocm-0.0.2.jar" }`
"uri" : "https://ocm.software/repository/ocm-mvn-test/open-component-model/hello-ocm/0.0.2/hello-ocm-0.0.2.jar" }`
var body maven.Body
err := json.Unmarshal([]byte(resp), &body)
Expect(err).To(BeNil())
Expect(body.Repo).To(Equal("ocm-mvn-test"))
Expect(body.DownloadUri).To(Equal("https://ocm.sofware/repository/ocm-mvn-test/open-component-model/hello-ocm/0.0.2/hello-ocm-0.0.2.jar"))
Expect(body.Uri).To(Equal("https://ocm.sofware/repository/ocm-mvn-test/open-component-model/hello-ocm/0.0.2/hello-ocm-0.0.2.jar"))
Expect(body.DownloadUri).To(Equal("https://ocm.software/repository/ocm-mvn-test/open-component-model/hello-ocm/0.0.2/hello-ocm-0.0.2.jar"))
Expect(body.Uri).To(Equal("https://ocm.software/repository/ocm-mvn-test/open-component-model/hello-ocm/0.0.2/hello-ocm-0.0.2.jar"))
Expect(body.MimeType).To(Equal("application/java-archive"))
Expect(body.Size).To(Equal("1792"))
Expect(body.Checksums["md5"]).To(Equal("6cb7520b65d820b3b35773a8daa8368e"))
Expand Down
2 changes: 1 addition & 1 deletion api/ocm/extensions/download/doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package download provides an API for resource download handlers.
// A download handler is used for downloading resoures. By default, the native
// A download handler is used for downloading resources. By default, the native
// blob as provided by the access method is the result of a download.
// A download handler can influence the outbound blob format according
// to the concrete type of the resource.
Expand Down
2 changes: 1 addition & 1 deletion api/ocm/extensions/download/handlers/plugin/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (b *pluginHandler) Download(_ common.Printer, racc cpi.ResourceAccess, path

finalize.Close(m, "method for download")
r := accessio.NewOndemandReader(m)
finalize.Close(r, "reader for downlowd download")
finalize.Close(r, "reader for download")

return b.plugin.Download(b.name, r, racc.Meta().Type, m.MimeType(), path, b.config)
}
2 changes: 1 addition & 1 deletion api/ocm/extensions/repositories/ctf/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ var _ = Describe("access method", func() {
Expect(err).To(MatchError(ContainSubstring("component version \"github.com/mandelsoft/ocm:1.0.0\" not found: oci artifact \"1.0.0\" not found in component-descriptors/github.com/mandelsoft/ocm")))
})

It("provides error for invalid bloc access", func() {
It("provides error for invalid blob access", func() {
final := Finalizer{}
defer Defer(final.Finalize)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
"ocm.software/ocm/api/version"
)

// newComponentVersionAccess creates a component access for the artifact access, if this fails the artifact acess is closed.
// newComponentVersionAccess creates a component access for the artifact access, if this fails the artifact access is closed.
func newComponentVersionAccess(mode accessobj.AccessMode, comp *componentAccessImpl, version string, access oci.ArtifactAccess, persistent bool) (*repocpi.ComponentVersionAccessInfo, error) {
c, err := newComponentVersionContainer(mode, comp, version, access)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions api/ocm/extensions/repositories/genericocireg/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ func (s *StateAccess) readComponentDescriptorFromTar(r io.Reader) ([]byte, error
// archive can be an image layer and that can even reach the gigabyte range.
// For now, we acknowledge the risk.
//
// We checked other softwares and tried to figure out how they manage this,
// We checked other software and tried to figure out how they manage this,
// but it's handled the same way.
if _, err := io.Copy(&data, tr); err != nil {
return nil, fmt.Errorf("erro while reading component descriptor file from tar: %w", err)
return nil, fmt.Errorf("error while reading component descriptor file from tar: %w", err)
}
return data.Bytes(), err
}
Expand Down
Loading

0 comments on commit 329ee5c

Please sign in to comment.