diff --git a/cmd/phase/run.go b/cmd/phase/run.go index fdd2f4689..83ebc0b63 100644 --- a/cmd/phase/run.go +++ b/cmd/phase/run.go @@ -22,7 +22,7 @@ import ( ) const ( - // TODO (kkalynovskyi) when different phase executors will be implmeneted, and their description is more clear, + // TODO (kkalynovskyi) when different phase executors will be implemented, and their description is more clear, // add documentation here. also consider adding dynamic phase descriptions based on executors. // TODO (kkalynovskyi) when this command is fully functional and phase executors are developed // remove phase apply command diff --git a/pkg/api/v1alpha1/clusterctl_types.go b/pkg/api/v1alpha1/clusterctl_types.go index 277bafc10..d3ff667ac 100644 --- a/pkg/api/v1alpha1/clusterctl_types.go +++ b/pkg/api/v1alpha1/clusterctl_types.go @@ -53,7 +53,7 @@ type Provider struct { // ignored if IsClusterctlRepository is set to true Versions map[string]string `json:"versions,omitempty"` - // VariableSubstitution indicates weather you want to substitute variales in the cluster-api manifests + // VariableSubstitution indicates weather you want to substitute variables in the cluster-api manifests // if set to true, variables will be substituted only if they are defined either in Environment or // in AdditionalComponentVariables, if not they will be left as is. VariableSubstitution bool `json:"variable-substitution,omitempty"` diff --git a/pkg/api/v1alpha1/phase_types.go b/pkg/api/v1alpha1/phase_types.go index c3f285d15..e33abb216 100644 --- a/pkg/api/v1alpha1/phase_types.go +++ b/pkg/api/v1alpha1/phase_types.go @@ -28,7 +28,7 @@ type Phase struct { Config PhaseConfig `json:"config,omitempty"` } -// PhaseConfig represents configuration for a particular phase. It contins a reference to +// PhaseConfig represents configuration for a particular phase. It contains a reference to // phase runner object which should contain runner configuration type PhaseConfig struct { ExecutorRef *corev1.ObjectReference `json:"executorRef"` diff --git a/pkg/bootstrap/isogen/executor_test.go b/pkg/bootstrap/isogen/executor_test.go index 0eb5269f8..38c5f1429 100644 --- a/pkg/bootstrap/isogen/executor_test.go +++ b/pkg/bootstrap/isogen/executor_test.go @@ -102,7 +102,7 @@ func TestExecutorRun(t *testing.T) { expectedEvt []events.Event }{ { - name: "Run isogen successefully", + name: "Run isogen successfully", builder: &mockContainer{ runCommand: func() error { return nil }, getID: func() string { return "TESTID" }, diff --git a/pkg/cluster/errors.go b/pkg/cluster/errors.go index 0a2c658f4..a0e67ee6b 100644 --- a/pkg/cluster/errors.go +++ b/pkg/cluster/errors.go @@ -26,7 +26,7 @@ func (err ErrInvalidStatusCheck) Error() string { return fmt.Sprintf("invalid status-check: %s", err.What) } -// ErrResourceNotFound is used when a resource is requrested from a StatusMap, +// ErrResourceNotFound is used when a resource is requested from a StatusMap, // but that resource can't be found type ErrResourceNotFound struct { Resource string diff --git a/pkg/clusterctl/client/client.go b/pkg/clusterctl/client/client.go index 669a735e3..470506e20 100644 --- a/pkg/clusterctl/client/client.go +++ b/pkg/clusterctl/client/client.go @@ -76,7 +76,7 @@ func (c *Client) Init(kubeconfigPath, kubeconfigContext string) error { // newConfig returns clusterctl config client func newConfig(options *airshipv1.Clusterctl, root string) (clusterctlconfig.Client, error) { for _, provider := range options.Providers { - // this is a workaround as cluserctl validates if URL is empty, even though it is not + // this is a workaround as clusterctl validates if URL is empty, even though it is not // used anywhere outside repository factory which we override // TODO (kkalynovskyi) we need to create issue for this in clusterctl, and remove URL // validation and move it to be an error during repository interface initialization diff --git a/pkg/clusterctl/client/factory.go b/pkg/clusterctl/client/factory.go index af79cbdea..fe4dbb7f4 100644 --- a/pkg/clusterctl/client/factory.go +++ b/pkg/clusterctl/client/factory.go @@ -77,7 +77,7 @@ func (f RepositoryFactory) repoFactory(provider config.Provider) (repository.Cli } // inject repository into repository client o := repository.InjectRepository(repo) - log.Printf("Creating arishipctl repository implementation interface for provider %s of type %s\n", + log.Printf("Creating airshipctl repository implementation interface for provider %s of type %s\n", name, repoType) diff --git a/pkg/clusterctl/client/move.go b/pkg/clusterctl/client/move.go index f4a337fdb..24a33c7b9 100644 --- a/pkg/clusterctl/client/move.go +++ b/pkg/clusterctl/client/move.go @@ -156,7 +156,7 @@ func pauseUnpauseBMHs(ctx context.Context, crClient client.Client, namespace str return nil } -// getBMHs will return all BareMetalHost objects in the specified namepace. +// getBMHs will return all BareMetalHost objects in the specified namespace. // It also checks to see if the BareMetalHost resource is installed, if not, // it will return false. func getBMHs(ctx context.Context, crClient client.Client, namespace string) (bmh.BareMetalHostList, error) { diff --git a/pkg/clusterctl/cmd/command_test.go b/pkg/clusterctl/cmd/command_test.go index db3f65176..96fa3bd89 100644 --- a/pkg/clusterctl/cmd/command_test.go +++ b/pkg/clusterctl/cmd/command_test.go @@ -36,14 +36,14 @@ func TestNewCommand(t *testing.T) { require.NoError(t, err) tests := []struct { - name string - expectErr bool - currentConext string - manifests map[string]*config.Manifest + name string + expectErr bool + currentContext string + manifests map[string]*config.Manifest }{ { - name: "default success", - currentConext: validContext, + name: "default success", + currentContext: validContext, manifests: map[string]*config.Manifest{ manifestName: { TargetPath: "testdata", @@ -56,9 +56,9 @@ func TestNewCommand(t *testing.T) { }, }, { - name: "Bundle build failure", - currentConext: validContext, - expectErr: true, + name: "Bundle build failure", + currentContext: validContext, + expectErr: true, manifests: map[string]*config.Manifest{ manifestName: { TargetPath: "testdata", @@ -71,9 +71,9 @@ func TestNewCommand(t *testing.T) { }, }, { - name: "invalid clusterctl kind", - currentConext: validContext, - expectErr: true, + name: "invalid clusterctl kind", + currentContext: validContext, + expectErr: true, manifests: map[string]*config.Manifest{ manifestName: { TargetPath: "testdata", @@ -95,9 +95,9 @@ func TestNewCommand(t *testing.T) { }, }, { - name: "cant find context", - currentConext: "invalid-context", - expectErr: true, + name: "cant find context", + currentContext: "invalid-context", + expectErr: true, manifests: map[string]*config.Manifest{ manifestName: { TargetPath: "testdata", @@ -114,7 +114,7 @@ func TestNewCommand(t *testing.T) { expectErr := tt.expectErr manifests := tt.manifests cfg.Manifests = manifests - context := tt.currentConext + context := tt.currentContext t.Run(tt.name, func(t *testing.T) { cfg.Manifests = manifests cfg.CurrentContext = context diff --git a/pkg/clusterctl/implementations/reader.go b/pkg/clusterctl/implementations/reader.go index 6b82fc828..23a17ad5e 100644 --- a/pkg/clusterctl/implementations/reader.go +++ b/pkg/clusterctl/implementations/reader.go @@ -95,12 +95,12 @@ func allowFromEnv(key string) bool { } func allowAppend(key, _ string) bool { - // TODO Investigate if more vaildation should be done here - forbidenVars := map[string]string{ + // TODO Investigate if more validation should be done here + forbiddenVars := map[string]string{ config.ProvidersConfigKey: "", imagesConfigKey: "", } - _, forbid := forbidenVars[key] + _, forbid := forbiddenVars[key] log.Debugf("Verifying that variable %s is allowed to be appended", key) return !forbid } diff --git a/pkg/clusterctl/implementations/repository_client_test.go b/pkg/clusterctl/implementations/repository_client_test.go index 1dfbfdda9..f67679cd6 100644 --- a/pkg/clusterctl/implementations/repository_client_test.go +++ b/pkg/clusterctl/implementations/repository_client_test.go @@ -72,7 +72,7 @@ func TestMissingVariableRepoClient(t *testing.T) { assert.Nil(t, c) } -func TestEnvVariableSubstiutionRepoClient(t *testing.T) { +func TestEnvVariableSubstitutionRepoClient(t *testing.T) { airRepoClient := testRepoClient(testRepoOpts{ kustRoot: "functions/5", envVars: true, @@ -114,7 +114,7 @@ func TestEnvVariableSubstiutionRepoClient(t *testing.T) { // are not. Clusterctl behavior doesn't allow to skip variable substitution completely // instead if SkipVariables is set to True, it will not throw errors if these variables // are not set in config reader. -func TestAdditionalVariableSubstiutionRepoClient(t *testing.T) { +func TestAdditionalVariableSubstitutionRepoClient(t *testing.T) { vars := map[string]string{ "AZURE_SUBSCRIPTION_ID_B64": "c29tZS1iYXNlNjQtSUQtdGV4dAo=", "AZURE_TENANT_ID_B64": "c29tZS1iYXNlNjQtVEVOQU5ULUlELXRleHQK", diff --git a/pkg/clusterctl/implementations/repository_test.go b/pkg/clusterctl/implementations/repository_test.go index 7c79b06fb..f474b060f 100644 --- a/pkg/clusterctl/implementations/repository_test.go +++ b/pkg/clusterctl/implementations/repository_test.go @@ -208,10 +208,10 @@ func TestGetFile(t *testing.T) { } else { assert.NoError(t, err) if fileToUse == "metadata.yaml" { - gotMetdata := metadata(t, b) + gotMetadata := metadata(t, b) parsedVersion, err := versionclient.ParseSemantic(versionToUse) require.NoError(t, err) - assert.Equal(t, resultContract, gotMetdata.GetReleaseSeriesForVersion(parsedVersion).Contract) + assert.Equal(t, resultContract, gotMetadata.GetReleaseSeriesForVersion(parsedVersion).Contract) } else { gotVersion := version(t, b) assert.Equal(t, resultVersion, gotVersion.Spec.Version) diff --git a/pkg/config/config.go b/pkg/config/config.go index 37b20d829..475c7728f 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -405,7 +405,7 @@ func (c *Config) ModifyContext(context *Context, theContext *ContextOptions) { } // GetCurrentContext methods Returns the appropriate information for the current context -// Current Context holds labels for the approriate config objects +// Current Context holds labels for the appropriate config objects // ClusterType is the name of the clustertype for this context, it should be a flag we pass to it?? // Manifest is the default manifest to be use with this context // Purpose for this method is simplifying the current context information diff --git a/pkg/config/errors.go b/pkg/config/errors.go index cf22f5349..66a8b4f9b 100644 --- a/pkg/config/errors.go +++ b/pkg/config/errors.go @@ -29,9 +29,9 @@ type ErrIncompatibleAuthOptions struct { AuthType string } -// NewErrIncompetibleAuthOptions returns Error of type +// NewErrIncompatibleAuthOptions returns Error of type // ErrIncompatibleAuthOptions -func NewErrIncompetibleAuthOptions(fo []string, ao string) error { +func NewErrIncompatibleAuthOptions(fo []string, ao string) error { return ErrIncompatibleAuthOptions{ ForbiddenOptions: fo, AuthType: ao, diff --git a/pkg/config/repo.go b/pkg/config/repo.go index 5bc9ec9d9..125503e6f 100644 --- a/pkg/config/repo.go +++ b/pkg/config/repo.go @@ -137,15 +137,15 @@ func (auth *RepoAuth) Validate() error { switch auth.Type { case SSHAuth: if auth.HTTPPassword != "" || auth.SSHPassword != "" { - return NewErrIncompetibleAuthOptions([]string{"http-pass, ssh-pass"}, auth.Type) + return NewErrIncompatibleAuthOptions([]string{"http-pass, ssh-pass"}, auth.Type) } case HTTPBasic: if auth.SSHPassword != "" || auth.KeyPath != "" || auth.KeyPassword != "" { - return NewErrIncompetibleAuthOptions([]string{"ssh-pass, ssh-key, key-pass"}, auth.Type) + return NewErrIncompatibleAuthOptions([]string{"ssh-pass, ssh-key, key-pass"}, auth.Type) } case SSHPass: if auth.KeyPath != "" || auth.KeyPassword != "" || auth.HTTPPassword != "" { - return NewErrIncompetibleAuthOptions([]string{"ssh-key, key-pass, http-pass"}, auth.Type) + return NewErrIncompatibleAuthOptions([]string{"ssh-key, key-pass, http-pass"}, auth.Type) } } return nil diff --git a/pkg/document/document_test.go b/pkg/document/document_test.go index 6b082cac4..746351d49 100644 --- a/pkg/document/document_test.go +++ b/pkg/document/document_test.go @@ -164,13 +164,13 @@ func TestDocument(t *testing.T) { docs, err := bundle.GetAllDocuments() require.NoError(err, "Unexpected error trying to GetAllDocuments") annotationMap := map[string]string{ - "test-annotation": "test-annotaiton-value", + "test-annotation": "test-annotation-value", } for _, doc := range docs { doc.Annotate(annotationMap) annotationList := doc.GetAnnotations() - assert.Equal(annotationList["test-annotation"], "test-annotaiton-value") + assert.Equal(annotationList["test-annotation"], "test-annotation-value") } }) @@ -268,7 +268,7 @@ stringData: expectedDocName: "control-0-bmc", }, { - name: "Manformed Bytes", + name: "Malformed Bytes", stringData: ` broken:fas -< fasd`, diff --git a/pkg/document/plugin/run_test.go b/pkg/document/plugin/run_test.go index 94423b7be..4402d9952 100644 --- a/pkg/document/plugin/run_test.go +++ b/pkg/document/plugin/run_test.go @@ -45,9 +45,9 @@ spec: { pluginCfg: []byte(`--- apiVersion: airshipit.org/v1alpha1 -kind: BareMetalGenereator +kind: BareMetalGenerator spec: - - someField: someValu`), + someField: someValue`), expectedError: "error converting YAML to JSON: yaml: line 4: block sequence entries are not allowed in this context", }, } diff --git a/pkg/document/selectors.go b/pkg/document/selectors.go index e46d10773..8a4fe9f23 100644 --- a/pkg/document/selectors.go +++ b/pkg/document/selectors.go @@ -44,7 +44,7 @@ func (s Selector) ByName(name string) Selector { return s } -// ByNamespace select by namepace +// ByNamespace select by namespace func (s Selector) ByNamespace(namespace string) Selector { s.Namespace = namespace return s diff --git a/pkg/events/events.go b/pkg/events/events.go index 1c653bfe2..a5aa821cd 100644 --- a/pkg/events/events.go +++ b/pkg/events/events.go @@ -78,7 +78,7 @@ type IsogenOperation int const ( // IsogenStart operation IsogenStart IsogenOperation = iota - // IsogenValidation opearation + // IsogenValidation operation IsogenValidation // IsogenEnd operation IsogenEnd diff --git a/pkg/k8s/applier/applier.go b/pkg/k8s/applier/applier.go index aab63c3bb..585a86fd1 100644 --- a/pkg/k8s/applier/applier.go +++ b/pkg/k8s/applier/applier.go @@ -45,7 +45,7 @@ const ( DefaultNamespace = "airshipit" ) -// Applier delivers documents to kubernetes in a declerative way +// Applier delivers documents to kubernetes in a declarative way type Applier struct { Driver Driver Factory cmdutil.Factory @@ -101,20 +101,20 @@ func (a *Applier) getInfos(bundleName string, bundle document.Bundle) ([]*resour ByKind(document.ConfigMapKind) // if we could find exactly one inventory document, we don't do anything else with it _, err := bundle.SelectOne(selector) - // if we got an error, which means we could not find Config Map with invetory ID at rest + // if we got an error, which means we could not find Config Map with inventory ID at rest // now we need to generate and inject one at runtime if err != nil && errors.As(err, &document.ErrDocNotFound{}) { - log.Debug("Inventory Object config Map not found, auto generating Invetory object") + log.Debug("Inventory Object config Map not found, auto generating Inventory object") invDoc, innerErr := NewInventoryDocument(bundleName) if innerErr != nil { // this should never happen - log.Debug("Failed to create new invetory document") + log.Debug("Failed to create new inventory document") return nil, innerErr } - log.Debugf("Injecting Invetory Object: %v into bundle", invDoc) + log.Debugf("Injecting Inventory Object: %v into bundle", invDoc) innerErr = bundle.Append(invDoc) if innerErr != nil { - log.Debug("Couldn't append bunlde with inventory document") + log.Debug("Couldn't append bundle with inventory document") return nil, innerErr } log.Debugf("Making sure that inventory object namespace %s exists", invDoc.GetNamespace()) @@ -180,7 +180,7 @@ type Adaptor struct { Factory cmdutil.Factory } -// Initialize sets fake required command line flags for underlaying cli-utils package +// Initialize sets fake required command line flags for underlying cli-utils package func (a *Adaptor) Initialize(p poller.Poller) error { cmd := &cobra.Command{} // Code below is copied from cli-utils package and used the same way as in upstream: @@ -215,7 +215,7 @@ func (a *Adaptor) Run(ctx context.Context, infos []*resource.Info, options cliap return a.CliUtilsApplier.Run(ctx, infos, options) } -// NewInventoryDocument returns default config map with invetory Id to group up the objects +// NewInventoryDocument returns default config map with inventory Id to group up the objects func NewInventoryDocument(inventoryID string) (document.Document, error) { cm := v1.ConfigMap{ TypeMeta: metav1.TypeMeta{ @@ -224,7 +224,7 @@ func NewInventoryDocument(inventoryID string) (document.Document, error) { }, ObjectMeta: metav1.ObjectMeta{ // name here is a dummy name, cli utils won't use this name, this config map simply parsed - // for invetory ID from label, and then ignores this config map + // for inventory ID from label, and then ignores this config map Name: fmt.Sprintf("%s-%s", "airshipit", inventoryID), // TODO this limits us to single namespace. research passing this as parameter from // somewhere higher level package that uses this module diff --git a/pkg/k8s/applier/executor_test.go b/pkg/k8s/applier/executor_test.go index e1872a35e..de99caaeb 100644 --- a/pkg/k8s/applier/executor_test.go +++ b/pkg/k8s/applier/executor_test.go @@ -141,7 +141,7 @@ metadata: } } -// TODO We need valid test that checks that actuall bundle has arrived to applier +// TODO We need valid test that checks that actual bundle has arrived to applier // for that we need a way to inject fake applier, which is not doable with `black box` test currently // since we tests are in different package from executor func TestExecutorRun(t *testing.T) { diff --git a/pkg/k8s/applier/fake.go b/pkg/k8s/applier/fake.go index ac9918130..79fdda436 100644 --- a/pkg/k8s/applier/fake.go +++ b/pkg/k8s/applier/fake.go @@ -40,7 +40,7 @@ type FakeAdaptor struct { var _ Driver = FakeAdaptor{} -// NewFakeAdaptor returns a fake driver interface with convience methods for testing +// NewFakeAdaptor returns a fake driver interface with convenience methods for testing func NewFakeAdaptor() FakeAdaptor { return FakeAdaptor{} } @@ -69,7 +69,7 @@ func (fa FakeAdaptor) WithEvents(events []applyevent.Event) FakeAdaptor { return fa } -// WithInitError adds error to Inititialize method +// WithInitError adds error to Initialize method func (fa FakeAdaptor) WithInitError(err error) FakeAdaptor { fa.initErr = err return fa diff --git a/pkg/k8s/utils/utils.go b/pkg/k8s/utils/utils.go index dbd933f66..4fb826ebd 100644 --- a/pkg/k8s/utils/utils.go +++ b/pkg/k8s/utils/utils.go @@ -60,7 +60,7 @@ var DefaultManifestReaderFactory ManifestReaderFactory = func( return NewManifestBundleReader(validate, bundle, factory) } -// NewManifestBundleReader returns impleemntation of manifestreader interface +// NewManifestBundleReader returns implementation of manifestreader interface func NewManifestBundleReader( validate bool, bundle document.Bundle, diff --git a/pkg/remote/errors.go b/pkg/remote/errors.go index efcbe5bec..cd62aad8d 100644 --- a/pkg/remote/errors.go +++ b/pkg/remote/errors.go @@ -26,7 +26,7 @@ type GenericError struct { Message string } -// NewRemoteDirectErrorf retruns formatted remote direct errors +// NewRemoteDirectErrorf returns formatted remote direct errors func NewRemoteDirectErrorf(format string, v ...interface{}) error { return &GenericError{Message: fmt.Sprintf(format, v...)} } diff --git a/testutil/fs/fs.go b/testutil/fs/fs.go index 9fd3da760..d34d878cc 100644 --- a/testutil/fs/fs.go +++ b/testutil/fs/fs.go @@ -31,15 +31,15 @@ type MockFileSystem struct { fs.FileSystem } -// RemoveAll Filesystem interface imlementation +// RemoveAll Filesystem interface implementation func (fsys MockFileSystem) RemoveAll(string) error { return fsys.MockRemoveAll() } -// TempFile Filesystem interface imlementation +// TempFile Filesystem interface implementation func (fsys MockFileSystem) TempFile(root, pattern string) (document.File, error) { return fsys.MockTempFile(root, pattern) } -// TempDir Filesystem interface imlementation +// TempDir Filesystem interface implementation func (fsys MockFileSystem) TempDir(string, string) (string, error) { return fsys.MockTempDir() } @@ -52,11 +52,11 @@ type TestFile struct { MockClose func() error } -// Name File interface imlementation +// Name File interface implementation func (f TestFile) Name() string { return f.MockName() } -// Write File interface imlementation +// Write File interface implementation func (f TestFile) Write([]byte) (int, error) { return f.MockWrite() } -// Close File interface imlementation +// Close File interface implementation func (f TestFile) Close() error { return f.MockClose() } diff --git a/testutil/k8sutils/mock_kubectl_factory.go b/testutil/k8sutils/mock_kubectl_factory.go index 3b47f2511..03ae18c39 100644 --- a/testutil/k8sutils/mock_kubectl_factory.go +++ b/testutil/k8sutils/mock_kubectl_factory.go @@ -319,7 +319,7 @@ func (i *InventoryObjectHandler) Handle(t *testing.T, req *http.Request) (*http. type GenericHandler struct { Obj runtime.Object Namespace string - // URLPath is a string for formater in which it should be defined how to inject a namespace into it + // URLPath is a string for formatter in which it should be defined how to inject a namespace into it // example : /namespaces/%s/deployments URLPath string Bytes []byte diff --git a/testutil/testconfig.go b/testutil/testconfig.go index 8efcd50e1..7e68f5a29 100644 --- a/testutil/testconfig.go +++ b/testutil/testconfig.go @@ -71,7 +71,7 @@ func DummyContext() *config.Context { // DummyManifest creates a Manifest config object for unit testing func DummyManifest() *config.Manifest { m := config.NewManifest() - // Repositories is the map of repository adddressable by a name + // Repositories is the map of repository addressable by a name m.Repositories = map[string]*config.Repository{"primary": DummyRepository()} m.PrimaryRepositoryName = "primary" m.TargetPath = "/var/tmp/"