diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b2908c7..54e6171b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Windows build now supported. - Added metrics to retrieve stats such as `procs_running` and `procs_blocked`. - Added metrics to retrieve network stats. -- Added metric to retrieve guest OS features such as unknwon modules, ktd, +- Added metric to retrieve guest OS features such as unknown modules, ktd, and kernel integrity. ### Changed @@ -237,7 +237,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Added resource limites to NPD deployment. - Added log-counter to dockerfile. - Added `enable_message_change_based_condition_update` option to enable - condition update when messages cahnge for custom plugin. + condition update when messages change for custom plugin. ### Fixed diff --git a/Makefile b/Makefile index 694394c2..417559ef 100644 --- a/Makefile +++ b/Makefile @@ -103,7 +103,7 @@ ifeq ($(ENABLE_JOURNALD), 1) CGO_ENABLED:=1 LOGCOUNTER=./bin/log-counter else - # Hack: Don't copy over log-counter, use a wildcard path that shouldnt match + # Hack: Don't copy over log-counter, use a wildcard path that shouldn't match # anything in COPY command. LOGCOUNTER=*dont-include-log-counter endif diff --git a/config/plugin/check_ntp.sh b/config/plugin/check_ntp.sh index e8c5ef6a..03e8f39e 100755 --- a/config/plugin/check_ntp.sh +++ b/config/plugin/check_ntp.sh @@ -20,8 +20,7 @@ if systemctl -q is-active "$SERVICE"; then echo "$SERVICE is running" exit $OK else - # Does not differenciate stopped/failed service from non-existent + # Does not differentiate stopped/failed service from non-existent echo "$SERVICE is not running" exit $NONOK fi - diff --git a/docs/custom_plugin_monitor.md b/docs/custom_plugin_monitor.md index ec032280..b73775fc 100644 --- a/docs/custom_plugin_monitor.md +++ b/docs/custom_plugin_monitor.md @@ -1,9 +1,11 @@ # Custom Plugin Monitor ## Configuration + ### Plugin Config + * `invoke_interval`: Interval at which custom plugins will be invoked. -* `timeout`: Time after which custom plugins invokation will be terminated and considered timeout. +* `timeout`: Time after which custom plugins invocation will be terminated and considered timeout. * `max_output_length`: The maximum standard output size from custom plugins that NPD will be cut and use for condition status message. * `concurrency`: The plugin worker number, i.e., how many custom plugins will be invoked concurrently. * `enable_message_change_based_condition_update`: Flag controls whether message change should result in a condition update. diff --git a/docs/release_process.md b/docs/release_process.md index 5a3b0a2c..e73a16b2 100644 --- a/docs/release_process.md +++ b/docs/release_process.md @@ -14,11 +14,11 @@ itself. viewing the changes on GitHub ([example: https://github.com/kubernetes/node-problem-detector/compare/v0.8.6...master](https://github.com/kubernetes/node-problem-detector/compare/v0.8.6...master)). -1. Based on the changes to be included in the release, determine what the next +2. Based on the changes to be included in the release, determine what the next release number should be. We strive to follow [SemVer](https://semver.org/) as much as possible. -1. Update [CHANGELOG](https://github.com/kubernetes/node-problem-detector/blob/master/CHANGELOG.md) +3. Update [CHANGELOG](https://github.com/kubernetes/node-problem-detector/blob/master/CHANGELOG.md) with all significant changes. ## Create release @@ -31,11 +31,11 @@ body of the release: release (e.g. [https://github.com/kubernetes/node-problem-detector/compare/v0.8.5...v0.8.6](https://github.com/kubernetes/node-problem-detector/compare/v0.8.5...v0.8.6)). -1. There is no need to duplicate everything from the CHANGELOG, but include the +2. There is no need to duplicate everything from the CHANGELOG, but include the most significant things so someone just viewing the release entry will have an idea of what it includes. -1. Provide a link to the new image release (e.g. `Image: +3. Provide a link to the new image release (e.g. `Image: k8s.gcr.io/node-problem-detector/node-problem-detector:v0.8.6`) ## Post release steps diff --git a/pkg/systemlogmonitor/logwatchers/filelog/log_watcher_test.go b/pkg/systemlogmonitor/logwatchers/filelog/log_watcher_test.go index 5b6652df..76843bb3 100644 --- a/pkg/systemlogmonitor/logwatchers/filelog/log_watcher_test.go +++ b/pkg/systemlogmonitor/logwatchers/filelog/log_watcher_test.go @@ -170,7 +170,7 @@ Jan 2 03:04:05 kernel: [2.000000] 3 } } // The log channel should have already been drained - // There could stil be future messages sent into the channel, but the chance is really slim. + // There could still be future messages sent into the channel, but the chance is really slim. timeout := time.After(100 * time.Millisecond) select { case log := <-logCh: diff --git a/pkg/systemlogmonitor/logwatchers/journald/log_watcher_test.go b/pkg/systemlogmonitor/logwatchers/journald/log_watcher_test.go index dab60491..8279729e 100644 --- a/pkg/systemlogmonitor/logwatchers/journald/log_watcher_test.go +++ b/pkg/systemlogmonitor/logwatchers/journald/log_watcher_test.go @@ -66,7 +66,7 @@ func TestTranslate(t *testing.T) { } func TestGoroutineLeak(t *testing.T) { - orignal := runtime.NumGoroutine() + original := runtime.NumGoroutine() w := NewJournaldWatcher(types.WatcherConfig{ Plugin: "journald", PluginConfig: map[string]string{"source": "not-exist-service"}, @@ -75,5 +75,5 @@ func TestGoroutineLeak(t *testing.T) { }) _, err := w.Watch() assert.Error(t, err) - assert.Equal(t, orignal, runtime.NumGoroutine()) + assert.Equal(t, original, runtime.NumGoroutine()) } diff --git a/pkg/systemstatsmonitor/disk_collector.go b/pkg/systemstatsmonitor/disk_collector.go index 7e30eed1..726e7bb7 100644 --- a/pkg/systemstatsmonitor/disk_collector.go +++ b/pkg/systemstatsmonitor/disk_collector.go @@ -274,7 +274,7 @@ func (dc *diskCollector) collect() { // to make sure that the rows are not duplicated // we display only the only one row even if there are - // mutiple rows for the same disk. + // multiple rows for the same disk. seen := make(map[string]bool) for _, partition := range partitions { if seen[partition.Device] { diff --git a/pkg/systemstatsmonitor/osfeature_collector.go b/pkg/systemstatsmonitor/osfeature_collector.go index ede1196b..a1d1332f 100644 --- a/pkg/systemstatsmonitor/osfeature_collector.go +++ b/pkg/systemstatsmonitor/osfeature_collector.go @@ -38,7 +38,7 @@ func NewOsFeatureCollectorOrDie(osFeatureConfig *ssmtypes.OSFeatureStatsConfig, procPath: procPath, } var err error - // Use metrics.Last aggregation method to ensure the metric is a guage metric. + // Use metrics.Last aggregation method to ensure the metric is a gauge metric. if osFeatureConfig.MetricsConfigs["system/os_feature"].DisplayName != "" { oc.osFeature, err = metrics.NewInt64Metric( metrics.OSFeatureID, diff --git a/pkg/types/types.go b/pkg/types/types.go index 1a36804d..44ccae6a 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -63,7 +63,7 @@ type Condition struct { Transition time.Time `json:"transition"` // Reason is a short reason of why node goes into this condition. Reason string `json:"reason"` - // Message is a human readable message of why node goes into this condition. + // Message is a human-readable message of why node goes into this condition. Message string `json:"message"` } @@ -75,7 +75,7 @@ type Event struct { Timestamp time.Time `json:"timestamp"` // Reason is a short reason of why the event is generated. Reason string `json:"reason"` - // Message is a human readable message of why the event is generated. + // Message is a human-readable message of why the event is generated. Message string `json:"message"` } @@ -113,7 +113,7 @@ type Monitor interface { // Exporter exports machine health data to certain control plane. type Exporter interface { - // Export problems to the control plane. + // ExportProblems Export problems to the control plane. ExportProblems(*Status) } diff --git a/pkg/util/helpers.go b/pkg/util/helpers.go index 41e9153c..66ab82b1 100644 --- a/pkg/util/helpers.go +++ b/pkg/util/helpers.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -50,7 +50,7 @@ func GetStartTime(now time.Time, uptimeDuration time.Duration, lookbackStr strin startTime = startTime.Add(delay) } - // Addjust startTime according to lookback duration + // Adjust startTime according to lookback duration lookbackStartTime := now if lookbackStr != "" { lookback, err := time.ParseDuration(lookbackStr) diff --git a/pkg/util/metrics/helpers_test.go b/pkg/util/metrics/helpers_test.go index 8be27bf0..59ba6b00 100644 --- a/pkg/util/metrics/helpers_test.go +++ b/pkg/util/metrics/helpers_test.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -53,7 +53,7 @@ func TestPrometheusMetricsParsingAndMatching(t *testing.T) { }, }, notExpectedMetrics: []Float64MetricRepresentation{ - // Metric with non-existant label. + // Metric with non-existent label. { Name: "host_uptime", Labels: map[string]string{"non-existant-version": "0.0.1"}, @@ -63,7 +63,7 @@ func TestPrometheusMetricsParsingAndMatching(t *testing.T) { Name: "host_uptime", Labels: map[string]string{"kernel_version": "mismatched-version"}, }, - // Non-existant metric. + // Non-existent metric. { Name: "host_downtime", Labels: map[string]string{}, @@ -99,17 +99,17 @@ func TestPrometheusMetricsParsingAndMatching(t *testing.T) { Name: "host_uptime", Labels: map[string]string{}, }, - // Metric with non-existant label. + // Metric with non-existent label. { Name: "host_uptime", - Labels: map[string]string{"non-existant-version": "0.0.1"}, + Labels: map[string]string{"non-existent-version": "0.0.1"}, }, // Metric with incorrect label. { Name: "host_uptime", Labels: map[string]string{"kernel_version": "mismatched-version"}, }, - // Non-existant metric. + // Non-existent metric. { Name: "host_downtime", Labels: map[string]string{}, diff --git a/pkg/util/metrics/system/cmdline_args.go b/pkg/util/metrics/system/cmdline_args.go index db1c53cf..48e0681b 100644 --- a/pkg/util/metrics/system/cmdline_args.go +++ b/pkg/util/metrics/system/cmdline_args.go @@ -56,7 +56,7 @@ func CmdlineArgs(cmdlineFilePath string) ([]CmdlineArg, error) { return nil, fmt.Errorf("error reading the file %s, %v", cmdlineFilePath, err) } if len(lines) < 1 { - return nil, fmt.Errorf("no lines are retured") + return nil, fmt.Errorf("no lines are returned") } cmdlineArgs := strings.FieldsFunc(lines[0], splitAfterSpace) var result = make([]CmdlineArg, 0, len(cmdlineArgs)) diff --git a/test/e2e/problemmaker/makers/filesystem.go b/test/e2e/problemmaker/makers/filesystem.go index a2f2e818..19e168be 100644 --- a/test/e2e/problemmaker/makers/filesystem.go +++ b/test/e2e/problemmaker/makers/filesystem.go @@ -32,6 +32,6 @@ func makeFilesystemError() { msg := []byte("fake filesystem error from problem-maker") err := ioutil.WriteFile(ext4ErrorTrigger, msg, 0200) if err != nil { - glog.Fatalf("Failed writting log to %q: %v", ext4ErrorTrigger, err) + glog.Fatalf("Failed writing log to %q: %v", ext4ErrorTrigger, err) } } diff --git a/test/e2e/problemmaker/makers/kernel.go b/test/e2e/problemmaker/makers/kernel.go index a3cf9a75..c4cf13a9 100644 --- a/test/e2e/problemmaker/makers/kernel.go +++ b/test/e2e/problemmaker/makers/kernel.go @@ -40,7 +40,7 @@ func writeKernelMessageOrDie(msg string) { for _, line := range strings.Split(msg, "\n") { err := ioutil.WriteFile(kmsgPath, []byte(line), 0644) if err != nil { - glog.Fatalf("Failed writting to %q: %v", kmsgPath, err) + glog.Fatalf("Failed writing to %q: %v", kmsgPath, err) } } } diff --git a/test/kernel_log_generator/generator.sh b/test/kernel_log_generator/generator.sh index dd863105..41f3e76f 100755 --- a/test/kernel_log_generator/generator.sh +++ b/test/kernel_log_generator/generator.sh @@ -17,7 +17,7 @@ # This script generate kernel log in given rate. # Note that this only works for journald. # Note that this script can't be used to test multi-line patterns, because -# the test kernel log lines may be splitted by real kernel log. +# the test kernel log lines may be split by real kernel log. # PROBLEM is the path to the problem log. PROBLEM=${PROBLEM:-""}