diff --git a/cmd/helm/dependency_update_test.go b/cmd/helm/dependency_update_test.go index 9afc04f8d..1f9d55867 100644 --- a/cmd/helm/dependency_update_test.go +++ b/cmd/helm/dependency_update_test.go @@ -111,9 +111,9 @@ func TestDependencyUpdateCmd(t *testing.T) { if _, err := os.Stat(expect); err != nil { t.Fatalf("Expected %q: %s", expect, err) } - dontExpect := dir(chartname, "charts/compressedchart-0.1.0.tgz") - if _, err := os.Stat(dontExpect); err == nil { - t.Fatalf("Unexpected %q", dontExpect) + unexpected := dir(chartname, "charts/compressedchart-0.1.0.tgz") + if _, err := os.Stat(unexpected); err == nil { + t.Fatalf("Unexpected %q", unexpected) } } diff --git a/cmd/helm/root.go b/cmd/helm/root.go index 3a15966bb..443d718d5 100644 --- a/cmd/helm/root.go +++ b/cmd/helm/root.go @@ -418,7 +418,7 @@ func newRootCmd(actionConfig *action.Configuration, out io.Writer, args []string registry.ClientOptWriter(out), ) if err != nil { - // TODO: dont panic here, refactor newRootCmd to return error + // TODO: don't panic here, refactor newRootCmd to return error panic(err) } actionConfig.RegistryClient = registryClient diff --git a/cmd/helm/root_test.go b/cmd/helm/root_test.go index 7d606b8a9..f3eef8b6d 100644 --- a/cmd/helm/root_test.go +++ b/cmd/helm/root_test.go @@ -31,7 +31,7 @@ func TestRootCmd(t *testing.T) { tests := []struct { name, args, cachePath, configPath, dataPath string - envars map[string]string + envvars map[string]string }{ { name: "defaults", @@ -40,19 +40,19 @@ func TestRootCmd(t *testing.T) { { name: "with $XDG_CACHE_HOME set", args: "home", - envars: map[string]string{xdg.CacheHomeEnvVar: "/bar"}, + envvars: map[string]string{xdg.CacheHomeEnvVar: "/bar"}, cachePath: "/bar/helm", }, { name: "with $XDG_CONFIG_HOME set", args: "home", - envars: map[string]string{xdg.ConfigHomeEnvVar: "/bar"}, + envvars: map[string]string{xdg.ConfigHomeEnvVar: "/bar"}, configPath: "/bar/helm", }, { name: "with $XDG_DATA_HOME set", args: "home", - envars: map[string]string{xdg.DataHomeEnvVar: "/bar"}, + envvars: map[string]string{xdg.DataHomeEnvVar: "/bar"}, dataPath: "/bar/helm", }, } @@ -61,7 +61,7 @@ func TestRootCmd(t *testing.T) { t.Run(tt.name, func(t *testing.T) { defer ensure.HelmHome(t)() - for k, v := range tt.envars { + for k, v := range tt.envvars { os.Setenv(k, v) } diff --git a/cmd/helm/verify.go b/cmd/helm/verify.go index 1cdd26290..d3ae517c9 100644 --- a/cmd/helm/verify.go +++ b/cmd/helm/verify.go @@ -27,7 +27,7 @@ import ( const verifyDesc = ` Verify that the given chart has a valid provenance file. -Provenance files provide crytographic verification that a chart has not been +Provenance files provide cryptographic verification that a chart has not been tampered with, and was packaged by a trusted provider. This command can be used to verify a local chart. Several other commands provide diff --git a/internal/experimental/registry/util.go b/internal/experimental/registry/util.go index 3a4589d01..697a890e3 100644 --- a/internal/experimental/registry/util.go +++ b/internal/experimental/registry/util.go @@ -49,7 +49,7 @@ func shortDigest(digest string) string { return digest } -// timeAgo returns a human-readable timestamp respresenting time that has passed +// timeAgo returns a human-readable timestamp representing time that has passed func timeAgo(t time.Time) string { return units.HumanDuration(time.Now().UTC().Sub(t)) } diff --git a/internal/ignore/rules.go b/internal/ignore/rules.go index c9aaeacca..9049aff0d 100644 --- a/internal/ignore/rules.go +++ b/internal/ignore/rules.go @@ -73,7 +73,7 @@ func Parse(file io.Reader) (*Rules, error) { return r, s.Err() } -// Ignore evalutes the file at the given path, and returns true if it should be ignored. +// Ignore evaluates the file at the given path, and returns true if it should be ignored. // // Ignore evaluates path against the rules in order. Evaluation stops when a match // is found. Matching a negative rule will stop evaluation. diff --git a/pkg/action/action.go b/pkg/action/action.go index f74a25e41..16c5d3546 100644 --- a/pkg/action/action.go +++ b/pkg/action/action.go @@ -66,7 +66,7 @@ var ValidName = regexp.MustCompile("^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])+ // Configuration injects the dependencies that all actions share. type Configuration struct { - // RESTClientGetter is an interface that loads Kuberbetes clients. + // RESTClientGetter is an interface that loads Kubernetes clients. RESTClientGetter RESTClientGetter // Releases stores records of releases. diff --git a/pkg/action/install.go b/pkg/action/install.go index dc5941810..e368bcb28 100644 --- a/pkg/action/install.go +++ b/pkg/action/install.go @@ -87,7 +87,7 @@ type Install struct { // APIVersions allows a manual set of supported API Versions to be passed // (for things like templating). These are ignored if ClientOnly is false APIVersions chartutil.VersionSet - // Used by helm template to render charts with .Relase.IsUpgrade. Ignored if Dry-Run is false + // Used by helm template to render charts with .Release.IsUpgrade. Ignored if Dry-Run is false IsUpgrade bool } diff --git a/pkg/action/list.go b/pkg/action/list.go index 4af0ef8e5..5d3417203 100644 --- a/pkg/action/list.go +++ b/pkg/action/list.go @@ -41,7 +41,7 @@ const ( ListPendingInstall // ListPendingUpgrade filters on status "pending_upgrade" (upgrade in progress) ListPendingUpgrade - // ListPendingRollback filters on status "pending_rollback" (rollback in progres) + // ListPendingRollback filters on status "pending_rollback" (rollback in progress) ListPendingRollback // ListSuperseded filters on status "superseded" (historical release version that is no longer deployed) ListSuperseded diff --git a/pkg/chart/dependency.go b/pkg/chart/dependency.go index 0837f8d19..9ec4544c2 100644 --- a/pkg/chart/dependency.go +++ b/pkg/chart/dependency.go @@ -53,7 +53,7 @@ type Dependency struct { // // It represents the state that the dependencies should be in. type Lock struct { - // Genderated is the date the lock file was last generated. + // Generated is the date the lock file was last generated. Generated time.Time `json:"generated"` // Digest is a hash of the dependencies in Chart.yaml. Digest string `json:"digest"` diff --git a/pkg/chart/loader/load_test.go b/pkg/chart/loader/load_test.go index 6576002eb..26513d359 100644 --- a/pkg/chart/loader/load_test.go +++ b/pkg/chart/loader/load_test.go @@ -461,7 +461,7 @@ func verifyChartFileAndTemplate(t *testing.T, c *chart.Chart, name string) { t.Fatalf("Expected 2 Dependency, got %d", len(dep.Dependencies())) } default: - t.Errorf("Unexpected dependeny %s", dep.Name()) + t.Errorf("Unexpected dependency %s", dep.Name()) } } } diff --git a/pkg/chartutil/chartfile.go b/pkg/chartutil/chartfile.go index 756b87cfb..808a902b1 100644 --- a/pkg/chartutil/chartfile.go +++ b/pkg/chartutil/chartfile.go @@ -43,7 +43,7 @@ func LoadChartfile(filename string) (*chart.Metadata, error) { // 'filename' should be the complete path and filename ('foo/Chart.yaml') func SaveChartfile(filename string, cf *chart.Metadata) error { // Pull out the dependencies of a v1 Chart, since there's no way - // to tell the serialiser to skip a field for just this use case + // to tell the serializer to skip a field for just this use case savedDependencies := cf.Dependencies if cf.APIVersion == chart.APIVersionV1 { cf.Dependencies = nil diff --git a/pkg/chartutil/doc.go b/pkg/chartutil/doc.go index 5dd9c7038..efcda2cfa 100644 --- a/pkg/chartutil/doc.go +++ b/pkg/chartutil/doc.go @@ -17,7 +17,7 @@ limitations under the License. /*Package chartutil contains tools for working with charts. Charts are described in the protocol buffer definition (pkg/proto/charts). -This packe provides utilities for serializing and deserializing charts. +This package provides utilities for serializing and deserializing charts. A chart can be represented on the file system in one of two ways: @@ -25,7 +25,7 @@ A chart can be represented on the file system in one of two ways: - As a tarred gzipped file containing a directory that then contains a Chart.yaml file. -This package provides utilitites for working with those file formats. +This package provides utilities for working with those file formats. The preferred way of loading a chart is using 'loader.Load`: diff --git a/pkg/chartutil/errors_test.go b/pkg/chartutil/errors_test.go index 3f9d04a71..3f63e3733 100644 --- a/pkg/chartutil/errors_test.go +++ b/pkg/chartutil/errors_test.go @@ -20,7 +20,7 @@ import ( "testing" ) -func TestErrorNoTableDoesntPanic(t *testing.T) { +func TestErrorNoTableDoesNotPanic(t *testing.T) { x := "empty" y := ErrNoTable{x} @@ -28,7 +28,7 @@ func TestErrorNoTableDoesntPanic(t *testing.T) { t.Logf("error is: %s", y) } -func TestErrorNoValueDoesntPanic(t *testing.T) { +func TestErrorNoValueDoesNotPanic(t *testing.T) { x := "empty" y := ErrNoValue{x} diff --git a/pkg/chartutil/jsonschema.go b/pkg/chartutil/jsonschema.go index 0848faaf2..753dc98c1 100644 --- a/pkg/chartutil/jsonschema.go +++ b/pkg/chartutil/jsonschema.go @@ -39,10 +39,10 @@ func ValidateAgainstSchema(chrt *chart.Chart, values map[string]interface{}) err } } - // For each dependency, recurively call this function with the coalesced values - for _, subchrt := range chrt.Dependencies() { - subchrtValues := values[subchrt.Name()].(map[string]interface{}) - if err := ValidateAgainstSchema(subchrt, subchrtValues); err != nil { + // For each dependency, recursively call this function with the coalesced values + for _, subchart := range chrt.Dependencies() { + subchartValues := values[subchart.Name()].(map[string]interface{}) + if err := ValidateAgainstSchema(subchart, subchartValues); err != nil { sb.WriteString(err.Error()) } } diff --git a/pkg/chartutil/jsonschema_test.go b/pkg/chartutil/jsonschema_test.go index 2677ee0ea..33f009259 100644 --- a/pkg/chartutil/jsonschema_test.go +++ b/pkg/chartutil/jsonschema_test.go @@ -63,7 +63,7 @@ func TestValidateAgainstSingleSchemaNegative(t *testing.T) { } } -const subchrtSchema = `{ +const subchartSchema = `{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Values", "type": "object", @@ -81,23 +81,23 @@ const subchrtSchema = `{ ` func TestValidateAgainstSchema(t *testing.T) { - subchrtJSON := []byte(subchrtSchema) - subchrt := &chart.Chart{ + subchartJSON := []byte(subchartSchema) + subchart := &chart.Chart{ Metadata: &chart.Metadata{ - Name: "subchrt", + Name: "subchart", }, - Schema: subchrtJSON, + Schema: subchartJSON, } chrt := &chart.Chart{ Metadata: &chart.Metadata{ Name: "chrt", }, } - chrt.AddDependency(subchrt) + chrt.AddDependency(subchart) vals := map[string]interface{}{ "name": "John", - "subchrt": map[string]interface{}{ + "subchart": map[string]interface{}{ "age": 25, }, } @@ -108,23 +108,23 @@ func TestValidateAgainstSchema(t *testing.T) { } func TestValidateAgainstSchemaNegative(t *testing.T) { - subchrtJSON := []byte(subchrtSchema) - subchrt := &chart.Chart{ + subchartJSON := []byte(subchartSchema) + subchart := &chart.Chart{ Metadata: &chart.Metadata{ - Name: "subchrt", + Name: "subchart", }, - Schema: subchrtJSON, + Schema: subchartJSON, } chrt := &chart.Chart{ Metadata: &chart.Metadata{ Name: "chrt", }, } - chrt.AddDependency(subchrt) + chrt.AddDependency(subchart) vals := map[string]interface{}{ - "name": "John", - "subchrt": map[string]interface{}{}, + "name": "John", + "subchart": map[string]interface{}{}, } var errString string @@ -134,7 +134,7 @@ func TestValidateAgainstSchemaNegative(t *testing.T) { errString = err.Error() } - expectedErrString := `subchrt: + expectedErrString := `subchart: - (root): age is required ` if errString != expectedErrString { diff --git a/pkg/chartutil/save.go b/pkg/chartutil/save.go index e264c4391..4ab9d3b24 100644 --- a/pkg/chartutil/save.go +++ b/pkg/chartutil/save.go @@ -142,7 +142,7 @@ func writeTarContents(out *tar.Writer, c *chart.Chart, prefix string) error { base := filepath.Join(prefix, c.Name()) // Pull out the dependencies of a v1 Chart, since there's no way - // to tell the serialiser to skip a field for just this use case + // to tell the serializer to skip a field for just this use case savedDependencies := c.Metadata.Dependencies if c.Metadata.APIVersion == chart.APIVersionV1 { c.Metadata.Dependencies = nil diff --git a/pkg/chartutil/testdata/subpop/charts/subchart1/values.yaml b/pkg/chartutil/testdata/subpop/charts/subchart1/values.yaml index 72d3fa5c8..a974e316a 100644 --- a/pkg/chartutil/testdata/subpop/charts/subchart1/values.yaml +++ b/pkg/chartutil/testdata/subpop/charts/subchart1/values.yaml @@ -23,7 +23,7 @@ overridden-chartA: SCAbool: true SCAfloat: 3.14 SCAint: 100 - SCAstring: "jabathehut" + SCAstring: "jabbathehut" SC1extra3: true imported-chartA-B: diff --git a/pkg/chartutil/values_test.go b/pkg/chartutil/values_test.go index a3fe7aeac..c95fa503a 100644 --- a/pkg/chartutil/values_test.go +++ b/pkg/chartutil/values_test.go @@ -76,7 +76,7 @@ func TestToRenderValues(t *testing.T) { }, } - overideValues := map[string]interface{}{ + overrideValues := map[string]interface{}{ "name": "Haroun", "where": map[string]interface{}{ "city": "Baghdad", @@ -103,7 +103,7 @@ func TestToRenderValues(t *testing.T) { IsInstall: true, } - res, err := ToRenderValues(c, overideValues, o, nil) + res, err := ToRenderValues(c, overrideValues, o, nil) if err != nil { t.Fatal(err) } @@ -275,10 +275,10 @@ chapter: } else if v != "Loomings" { t.Errorf("No error but got wrong value for title: %s\n%v", err, d) } - if _, err := d.PathValue("chapter.one.doesntexist"); err == nil { + if _, err := d.PathValue("chapter.one.doesnotexist"); err == nil { t.Errorf("Non-existent key should return error: %s\n%v", err, d) } - if _, err := d.PathValue("chapter.doesntexist.one"); err == nil { + if _, err := d.PathValue("chapter.doesnotexist.one"); err == nil { t.Errorf("Non-existent key in middle of path should return error: %s\n%v", err, d) } if _, err := d.PathValue(""); err == nil { diff --git a/pkg/cli/environment.go b/pkg/cli/environment.go index 28e7873be..5f947aec7 100644 --- a/pkg/cli/environment.go +++ b/pkg/cli/environment.go @@ -52,7 +52,7 @@ type EnvSettings struct { RegistryConfig string // RepositoryConfig is the path to the repositories file. RepositoryConfig string - // Repositoryache is the path to the repository cache directory. + // RepositoryCache is the path to the repository cache directory. RepositoryCache string // PluginsDirectory is the path to the plugins directory. PluginsDirectory string diff --git a/pkg/cli/environment_test.go b/pkg/cli/environment_test.go index d6856dd01..fadc2981e 100644 --- a/pkg/cli/environment_test.go +++ b/pkg/cli/environment_test.go @@ -29,8 +29,8 @@ func TestEnvSettings(t *testing.T) { name string // input - args string - envars map[string]string + args string + envvars map[string]string // expected values ns, kcontext string @@ -47,17 +47,17 @@ func TestEnvSettings(t *testing.T) { debug: true, }, { - name: "with envvars set", - envars: map[string]string{"HELM_DEBUG": "1", "HELM_NAMESPACE": "yourns"}, - ns: "yourns", - debug: true, + name: "with envvars set", + envvars: map[string]string{"HELM_DEBUG": "1", "HELM_NAMESPACE": "yourns"}, + ns: "yourns", + debug: true, }, { - name: "with flags and envvars set", - args: "--debug --namespace=myns", - envars: map[string]string{"HELM_DEBUG": "1", "HELM_NAMESPACE": "yourns"}, - ns: "myns", - debug: true, + name: "with flags and envvars set", + args: "--debug --namespace=myns", + envvars: map[string]string{"HELM_DEBUG": "1", "HELM_NAMESPACE": "yourns"}, + ns: "myns", + debug: true, }, } @@ -65,7 +65,7 @@ func TestEnvSettings(t *testing.T) { t.Run(tt.name, func(t *testing.T) { defer resetEnv()() - for k, v := range tt.envars { + for k, v := range tt.envvars { os.Setenv(k, v) } diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go index 5a7d54993..d0261dca2 100644 --- a/pkg/engine/engine.go +++ b/pkg/engine/engine.go @@ -100,7 +100,7 @@ func (e Engine) initFunMap(t *template.Template, referenceTpls map[string]render var buf strings.Builder for _, n := range includedNames { if n == name { - return "", errors.Wrapf(fmt.Errorf("unable to excute template"), "rendering template has a nested reference name: %s", name) + return "", errors.Wrapf(fmt.Errorf("unable to execute template"), "rendering template has a nested reference name: %s", name) } } includedNames = append(includedNames, name) diff --git a/pkg/getter/httpgetter.go b/pkg/getter/httpgetter.go index 89abfb1cf..5b476ff2d 100644 --- a/pkg/getter/httpgetter.go +++ b/pkg/getter/httpgetter.go @@ -27,7 +27,7 @@ import ( "helm.sh/helm/v3/internal/version" ) -// HTTPGetter is the efault HTTP(/S) backend handler +// HTTPGetter is the default HTTP(/S) backend handler type HTTPGetter struct { opts options } diff --git a/pkg/lint/rules/chartfile.go b/pkg/lint/rules/chartfile.go index 70cb83bc5..91a64fe13 100644 --- a/pkg/lint/rules/chartfile.go +++ b/pkg/lint/rules/chartfile.go @@ -40,7 +40,7 @@ func Chartfile(linter *support.Linter) { chartFile, err := chartutil.LoadChartfile(chartPath) validChartFile := linter.RunLinterRule(support.ErrorSev, chartFileName, validateChartYamlFormat(err)) - // Guard clause. Following linter rules require a parseable ChartFile + // Guard clause. Following linter rules require a parsable ChartFile if !validChartFile { return } diff --git a/pkg/plugin/installer/http_installer_test.go b/pkg/plugin/installer/http_installer_test.go index 89884f107..cfa2e4cbe 100644 --- a/pkg/plugin/installer/http_installer_test.go +++ b/pkg/plugin/installer/http_installer_test.go @@ -234,12 +234,12 @@ func TestExtract(t *testing.T) { gz.Close() // END tarball creation - extr, err := NewExtractor(source) + extractor, err := NewExtractor(source) if err != nil { t.Fatal(err) } - if err = extr.Extract(&buf, tempDir); err != nil { + if err = extractor.Extract(&buf, tempDir); err != nil { t.Errorf("Did not expect error but got error: %v", err) } diff --git a/pkg/plugin/installer/vcs_installer.go b/pkg/plugin/installer/vcs_installer.go index 21a65cd13..1a5d74cca 100644 --- a/pkg/plugin/installer/vcs_installer.go +++ b/pkg/plugin/installer/vcs_installer.go @@ -135,7 +135,7 @@ func (i *VCSInstaller) solveVersion(repo vcs.Repo) (string, error) { sort.Sort(sort.Reverse(semver.Collection(semvers))) for _, v := range semvers { if constraint.Check(v) { - // If the constrint passes get the original reference + // If the constraint passes get the original reference ver := v.Original() debug("setting to %s", ver) return ver, nil diff --git a/pkg/release/status.go b/pkg/release/status.go index 0e535f9a4..49b0f1544 100644 --- a/pkg/release/status.go +++ b/pkg/release/status.go @@ -25,7 +25,7 @@ const ( StatusUnknown Status = "unknown" // StatusDeployed indicates that the release has been pushed to Kubernetes. StatusDeployed Status = "deployed" - // StatusUninstalled indicates that a release has been uninstalled from Kubermetes. + // StatusUninstalled indicates that a release has been uninstalled from Kubernetes. StatusUninstalled Status = "uninstalled" // StatusSuperseded indicates that this release object is outdated and a newer one exists. StatusSuperseded Status = "superseded" diff --git a/pkg/repo/chartrepo_test.go b/pkg/repo/chartrepo_test.go index 9f4273682..c6b227acf 100644 --- a/pkg/repo/chartrepo_test.go +++ b/pkg/repo/chartrepo_test.go @@ -237,7 +237,7 @@ func verifyIndex(t *testing.T, actual *IndexFile) { t.Errorf("Expected %q, got %q", e.Version, g.Version) } if len(g.Keywords) != 3 { - t.Error("Expected 3 keyrwords.") + t.Error("Expected 3 keywords.") } if len(g.Maintainers) != 2 { t.Error("Expected 2 maintainers.") diff --git a/pkg/repo/doc.go b/pkg/repo/doc.go index 19ccf267c..05650100b 100644 --- a/pkg/repo/doc.go +++ b/pkg/repo/doc.go @@ -27,7 +27,7 @@ The first is the 'index.yaml' format, which is expressed like this: entries: frobnitz: - created: 2016-09-29T12:14:34.830161306-06:00 - description: This is a frobniz. + description: This is a frobnitz. digest: 587bd19a9bd9d2bc4a6d25ab91c8c8e7042c47b4ac246e37bf8e1e74386190f4 home: http://example.com keywords: diff --git a/pkg/repo/index_test.go b/pkg/repo/index_test.go index bc0b45e2c..c830a339e 100644 --- a/pkg/repo/index_test.go +++ b/pkg/repo/index_test.go @@ -131,7 +131,7 @@ func TestMerge(t *testing.T) { if len(ind1.Entries) != 2 { t.Errorf("Expected 2 entries, got %d", len(ind1.Entries)) - vs := ind1.Entries["dreadnaught"] + vs := ind1.Entries["dreadnought"] if len(vs) != 2 { t.Errorf("Expected 2 versions, got %d", len(vs)) } diff --git a/pkg/storage/driver/secrets.go b/pkg/storage/driver/secrets.go index eea285be1..dc55cf458 100644 --- a/pkg/storage/driver/secrets.go +++ b/pkg/storage/driver/secrets.go @@ -44,7 +44,7 @@ type Secrets struct { Log func(string, ...interface{}) } -// NewSecrets initializes a new Secrets wrapping an implmenetation of +// NewSecrets initializes a new Secrets wrapping an implementation of // the kubernetes SecretsInterface. func NewSecrets(impl corev1.SecretInterface) *Secrets { return &Secrets{