Skip to content
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
8 changes: 1 addition & 7 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ linters:
# TODO(wojtek-t): Reenable after fixing existing issues.
# - errcheck
- unused
# TODO(kushthedude) fix after vendor is migrated to go modules
# - misspell
- misspell
settings:
errcheck:
# Workaround for https://github.com/golangci/golangci-lint/issues/4733
Expand All @@ -31,11 +30,6 @@ linters:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
# TODO(kushthedude) remove the disabled checks
disable:
# TODO(wojtek-t): Reenable after fixing existing issues.
# - composites
- copylocks

formatters:
enable:
Expand Down
2 changes: 1 addition & 1 deletion clusterloader2/pkg/chaos/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (k *NodeKiller) Summary() string {
var sb strings.Builder
sb.WriteString(fmt.Sprintf("%s: Recorded following events\n", k))
for _, e := range k.recorder.events {
sb.WriteString(fmt.Sprintf("%s: At %v %v happend for node %s\n", k, e.time.Format(time.UnixDate), e.action, e.nodeName))
sb.WriteString(fmt.Sprintf("%s: At %v %v happened for node %s\n", k, e.time.Format(time.UnixDate), e.action, e.nodeName))
}
return sb.String()
}
Expand Down
4 changes: 2 additions & 2 deletions clusterloader2/pkg/config/template_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func GetFuncs(fsys fs.FS) template.FuncMap {
// seq returns a slice of size 'size' filled with zeros.
// Deprecated: Naming generates confusion. Please use 'SliceOfZeros' for explicit zero values or 'Loop' for incremental integer generation.
func seq(size interface{}) []int {
klog.Warningf("Seq is deprecated. Instead please use 'SliceOfZeros' to replicate current behaviour or 'Loop' for simple incremential integer generation.")
klog.Warningf("Seq is deprecated. Instead please use 'SliceOfZeros' to replicate current behavior or 'Loop' for simple incremental integer generation.")
return sliceOfZeros(size)
}

Expand Down Expand Up @@ -336,7 +336,7 @@ func concat(items ...string) string {
return ret
}

// loop returns a slice with incremential values starting from zero.
// loop returns a slice with incremental values starting from zero.
func loop(size interface{}) []int {
sizeInt := int(toFloat64(size))
slice := make([]int, sizeInt)
Expand Down
2 changes: 1 addition & 1 deletion clusterloader2/pkg/framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var namespaceID = regexp.MustCompile(`^test-[a-z0-9]+-[0-9]+$`)
type Framework struct {
automanagedNamespacePrefix string
mux sync.Mutex
// automanagedNamespaces stores values as infromation if should the namespace be deleted
// automanagedNamespaces stores values as information if should the namespace be deleted
automanagedNamespaces map[string]bool
clientSets *MultiClientSet
dynamicClients *MultiDynamicClient
Expand Down
2 changes: 1 addition & 1 deletion clusterloader2/pkg/measurement/common/pod_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ func (p *podPeriodicCommandMeasurement) runCommandInPod(
// Two different cases: (1) if the command returns before the timeout, and (2) if the timeout
// triggers before the command is done.
// The value result.EndTime is set in both cases.
// If the timeout triggers, then the command isn't actually cancelled. This logic isn't available until
// If the timeout triggers, then the command isn't actually canceled. This logic isn't available until
// client-go version 0.26 (see Executor.StreamWithContext).
select {
case err = <-execErrChan:
Expand Down
6 changes: 3 additions & 3 deletions clusterloader2/pkg/measurement/common/scheduler_latency.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ func (*schedulerLatencyMeasurement) String() string {
return schedulerLatencyMetricName
}

// HistogramSub is a helper function to substract two histograms
// HistogramSub is a helper function to subtract two histograms
func HistogramSub(finalHist, initialHist *measurementutil.Histogram) *measurementutil.Histogram {
for k := range finalHist.Buckets {
finalHist.Buckets[k] = finalHist.Buckets[k] - initialHist.Buckets[k]
}
return finalHist
}

func (m *schedulerLatencyMetrics) substract(sub schedulerLatencyMetrics) {
func (m *schedulerLatencyMetrics) subtract(sub schedulerLatencyMetrics) {
if sub.preemptionEvaluationHist != nil {
m.preemptionEvaluationHist = HistogramSub(m.preemptionEvaluationHist, sub.preemptionEvaluationHist)
}
Expand Down Expand Up @@ -203,7 +203,7 @@ func (s *schedulerLatencyMeasurement) getSchedulingLatency(c clientset.Interface
if err != nil {
return nil, err
}
schedulerMetrics.substract(s.initialLatency)
schedulerMetrics.subtract(s.initialLatency)
result, err := s.setQuantiles(schedulerMetrics)
if err != nil {
return nil, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func Test_getMeasurementConfig(t *testing.T) {
}
}

func Test_getMeasurementConfig_incorect_overrides(t *testing.T) {
func Test_getMeasurementConfig_incorrect_overrides(t *testing.T) {
config := &measurement.Config{
Params: map[string]interface{}{
"threshold": 100,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ func (w *waitForControlledPodsRunningMeasurement) updateCacheLocked(oldObj, newO
func (w *waitForControlledPodsRunningMeasurement) updateOpResourceVersionLocked(runtimeObj runtime.Object) error {
version, err := runtimeobjects.GetResourceVersionFromRuntimeObject(runtimeObj)
if err != nil {
return fmt.Errorf("retriving resource version error: %v", err)
return fmt.Errorf("retrieving resource version error: %v", err)
}
if version > w.opResourceVersion {
w.opResourceVersion = version
Expand Down Expand Up @@ -548,7 +548,7 @@ func (w *waitForControlledPodsRunningMeasurement) getObjectKeysAndMaxVersion() (
}
version, err := runtimeobjects.GetResourceVersionFromRuntimeObject(runtimeObj)
if err != nil {
klog.Errorf("%s: retriving resource version error: %v", w, err)
klog.Errorf("%s: retrieving resource version error: %v", w, err)
continue
}
key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(runtimeObj)
Expand Down
2 changes: 1 addition & 1 deletion clusterloader2/pkg/prometheus/experimental.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (pc *Controller) tryRetrievePrometheusDiskMetadata() (bool, error) {
klog.V(2).Info("PV list was:")
s, err := json.MarshalIndent(list, "" /*=prefix*/, " " /*=indent*/)
if err != nil {
klog.Warningf("Error while marshalling response %v: %v", list, err)
klog.Warningf("Error while marshaling response %v: %v", list, err)
return true, err
}
klog.V(2).Info(string(s))
Expand Down
2 changes: 1 addition & 1 deletion clusterloader2/pkg/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ func dumpAdditionalLogsOnPrometheusSetupFailure(k8sClient kubernetes.Interface)
}
s, err := json.MarshalIndent(list, "" /*=prefix*/, " " /*=indent*/)
if err != nil {
klog.Warningf("Error while marshalling response %v: %v", list, err)
klog.Warningf("Error while marshaling response %v: %v", list, err)
return
}
klog.V(2).Info(string(s))
Expand Down
2 changes: 1 addition & 1 deletion perfdash/local_metrics_dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (b *LocalMetricsDirectory) GetBuildNumbers(job string) ([]int, error) {

// ListFilesInBuild recursively fetches the files in the build from a local artifacts directory.
// Note: artifacts are expected to be in dirPath such in the format of dirPath/job/buildNumber.
// For example, it could be in artifacts/my-job/1234567890/aritfacts.
// For example, it could be in artifacts/my-job/1234567890/artifacts.
func (b *LocalMetricsDirectory) ListFilesInBuild(job string, buildNumber int, prefix string) ([]string, error) {
filePath := joinStringsAndInts(b.dirPath, filePathSeparator, job, filePathSeparator, buildNumber, prefix)

Expand Down
2 changes: 1 addition & 1 deletion slo-monitor/src/monitors/pod_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var (
// StartupLatencyBuckets represents the histogram bucket boundaries for pod
// startup latency metrics, measured in seconds. These are hand-picked so
// as to be roughly exponential but still round numbers in everyday units.
// This is to minimise the number of buckets while allowing accurate
// This is to minimize the number of buckets while allowing accurate
// measurement of thresholds which might be used in SLOs e.g. x% of pods
// start up within 30 seconds, or 15 minutes, etc.
StartupLatencyBuckets = []float64{0.5, 1, 2, 3, 4, 5, 6, 8, 10, 20, 30, 45, 60, 120, 180, 240, 300, 360, 480, 600, 900, 1200, 1800, 2700, 3600}
Expand Down
4 changes: 2 additions & 2 deletions util-images/network/netperfbenchmark/pkg/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,11 @@ func (w *Worker) sendResponse(rw http.ResponseWriter, statusCode int, response i
rw.Header().Set("Content-Type", "application/json")
marshalledResponse, err := json.Marshal(response)
if err != nil {
klog.Errorf("Error marshalling to json: %v", err)
klog.Errorf("Error marshaling to json: %v", err)
rw.WriteHeader(http.StatusInternalServerError)
return
}
klog.V(3).Infof("Marshalled Response: %v", response)
klog.V(3).Infof("Marshaled Response: %v", response)
rw.WriteHeader(statusCode)
if _, err := rw.Write(marshalledResponse); err != nil {
klog.Errorf("Error writing response to ResponseWriter: %v", err)
Expand Down