Commit Graph

14 Commits

Author SHA1 Message Date
Manuel Rüger
6b7027ff41 Harden and add gosec linter
Remediate:
G104: Errors unhandled.
G109: Potential Integer overflow made by strconv.Atoi result conversion to int16/32
G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server
G304: Potential file inclusion via variable
G601: Implicit memory aliasing in for loop.

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-10-20 20:44:46 +02:00
Kubernetes Prow Robot
4bb1b38397 Merge pull request #1807 from dmpe/strcuturedlogging_part1
feat(logging): migration to structure logging for main.go, pkg/ & internal/ folders
2022-08-16 00:17:07 -07:00
Manuel Rüger
2f20203c09 Replace pkg/errors with stdlib errors
github.com/pkg/errors is archived and not maintained anymore.
Replace it with stdlib functions.

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-08-15 20:25:09 +02:00
John
a2ccd75234 Apply suggestions from code review
Co-authored-by: JUN YANG <yang.jun22@zte.com.cn>
2022-08-13 14:46:18 +02:00
dmpe
f406c1aa1d feat(logging): migrate to structured logging
Signed-off-by: dmpe <John Malc> <cincenko@outlook.com>
2022-08-13 14:18:56 +02:00
FillZpp
4f76df332f Use BuilderInterface instead of internal/store.Builder in metricshandler
Signed-off-by: FillZpp <FillZpp.pub@gmail.com>
2021-07-22 14:41:05 +08:00
fpetkovski
83887f1611 Replace multiListerWatcher with independent listWatchers per namespace
The multiListerWatcher is a composite object encapsulating multiple
ListerWatchers and implements the ListerWatcher interface.
With the current implementation, when an individual lister fails, the
entire List operation fails. This causes no metrics to be shown when KSM
has no permissions to a single namespace.

In addition to this, the multiListerWatcher takes advantage of internal
implementation details if the client-go library by modifiying and
relying on the ResourceVersion metadata field. This introduces a bug
where reconnecting to the API server will break the multiListerWatcher
completely.

This commit replaces the multiListerWatcher with individual
ListerWatchers per each configured namespace, resolving both issues.

Signed-off-by: fpetkovski <filip.petkovsky@gmail.com>
2021-06-29 13:27:57 +02:00
lou-lan
483b77a523 Fix gzip writer 2021-02-15 21:57:20 +08:00
Lili Cosic
4093cb34de Adjust klog to klog/v2 2020-10-05 15:29:12 +02:00
Quentin Bisson
7250bc2b5c Update go module path to k8s.io/kube-state-metrics/v2
Signed-off-by: Quentin Bisson <quentin@giantswarm.io>
2020-09-21 10:58:08 +02:00
Prabhakar Mishra
0ff5482079 update client-go, k/api, k/apimachinery to v1.18.6 and vertical-pod-autoscaler to commit b7922d74509c
use clientgofix library

add context parameter in verticalpodautoscaler

rename PodDisruptionsAllowed to DisruptionsAllowed because of PR 85863 in k8s repo

lint fixes and rename PodDisruptionsAllowed to DisruptionsAllowed in test file

run go mod tidy
2020-07-30 01:54:34 +02:00
cedric lamoriniere
494efc6fe5 [Builder] Allow custom Store generation func
- Use `cache.Store` interface for genericity and extensibility.
- Add `WithCustomGenerateStoreFunc` method to `Builder` struct for allowing
  custome metrics Stores generation.

Signed-off-by: cedric lamoriniere <cedric.lamoriniere@datadoghq.com>
2019-12-13 10:49:13 +01:00
Ben Wells
a6fa888e73 Remove unnecessary type conversion 2019-10-06 10:38:11 +01:00
Frederic Branczyk
f3d41de450 Add auto detecting of sharding
main_test.go: Add model based test for sharding

In order to ensure a sharded system behaves equal to an unsharded
system, a model based test has been introduced. It scrapes an unsharded
setup and compares its output with the union of a sharded setup
therefore ensuring semantic equality.
2019-08-30 22:45:35 +02:00