Skip to content

Commit 471dc5a

Browse files
authored
feat: add certificates to cluster insight component scraper (#347)
* add certificates to cluster insight component scraper * fix flaky test
1 parent c1124a1 commit 471dc5a

File tree

6 files changed

+136
-92
lines changed

6 files changed

+136
-92
lines changed

cmd/agent/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

88
trivy "github.com/aquasecurity/trivy-operator/pkg/apis/aquasecurity/v1alpha1"
99
rolloutv1alpha1 "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1"
10+
certmanagerv1 "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1"
1011
templatesv1 "github.com/open-policy-agent/frameworks/constraint/pkg/apis/templates/v1"
1112
constraintstatusv1beta1 "github.com/open-policy-agent/gatekeeper/v3/apis/status/v1beta1"
1213
deploymentsv1alpha1 "github.com/pluralsh/deployment-operator/api/v1alpha1"
@@ -40,6 +41,7 @@ func init() {
4041
utilruntime.Must(constraintstatusv1beta1.AddToScheme(scheme))
4142
utilruntime.Must(templatesv1.AddToScheme(scheme))
4243
utilruntime.Must(rolloutv1alpha1.AddToScheme(scheme))
44+
utilruntime.Must(certmanagerv1.AddToScheme(scheme))
4345
//+kubebuilder:scaffold:scheme
4446
}
4547

@@ -74,7 +76,7 @@ func main() {
7476
cache.RunDiscoveryCacheInBackgroundOrDie(ctx, discoveryClient)
7577

7678
// Start AI insight component scraper in background
77-
scraper.RunAiInsightComponentScraperInBackgroundOrDie(ctx, kubeManager.GetClient())
79+
scraper.RunAiInsightComponentScraperInBackgroundOrDie(ctx, kubeManager.GetClient(), discoveryClient)
7880

7981
// Start the console manager in background.
8082
runConsoleManagerInBackgroundOrDie(ctx, consoleManager)

go.mod

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ require (
1111
github.com/aquasecurity/trivy-db v0.0.0-20231020043206-3770774790ce
1212
github.com/aquasecurity/trivy-operator v0.22.0
1313
github.com/argoproj/argo-rollouts v1.7.2
14-
github.com/aws/aws-sdk-go-v2 v1.30.5
15-
github.com/aws/aws-sdk-go-v2/config v1.27.33
16-
github.com/aws/aws-sdk-go-v2/credentials v1.17.32
14+
github.com/aws/aws-sdk-go-v2 v1.31.0
15+
github.com/aws/aws-sdk-go-v2/config v1.27.36
16+
github.com/aws/aws-sdk-go-v2/credentials v1.17.34
1717
github.com/aws/aws-sdk-go-v2/service/eks v1.48.4
18+
github.com/cert-manager/cert-manager v1.16.2
1819
github.com/elastic/crd-ref-docs v0.1.0
1920
github.com/evanphx/json-patch v5.9.0+incompatible
2021
github.com/fluxcd/flagger v1.38.0
@@ -37,7 +38,7 @@ require (
3738
github.com/pluralsh/controller-reconcile-helper v0.1.0
3839
github.com/pluralsh/gophoenix v0.1.3-0.20231201014135-dff1b4309e34
3940
github.com/pluralsh/polly v0.1.10
40-
github.com/prometheus/client_golang v1.20.3
41+
github.com/prometheus/client_golang v1.20.4
4142
github.com/samber/lo v1.47.0
4243
github.com/sirupsen/logrus v1.9.3
4344
github.com/spf13/pflag v1.0.5
@@ -57,7 +58,7 @@ require (
5758
k8s.io/klog/v2 v2.130.1
5859
k8s.io/kubectl v0.31.1
5960
k8s.io/metrics v0.31.1
60-
k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3
61+
k8s.io/utils v0.0.0-20240921022957-49e7df575cb6
6162
layeh.com/gopher-luar v1.0.11
6263
sigs.k8s.io/cli-utils v0.37.2
6364
sigs.k8s.io/controller-runtime v0.19.0
@@ -72,9 +73,9 @@ require (
7273
4d63.com/gocheckcompilerdirectives v1.2.1 // indirect
7374
4d63.com/gochecknoglobals v0.2.1 // indirect
7475
cloud.google.com/go v0.115.1 // indirect
75-
cloud.google.com/go/auth v0.9.3 // indirect
76+
cloud.google.com/go/auth v0.9.4 // indirect
7677
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
77-
cloud.google.com/go/compute/metadata v0.5.0 // indirect
78+
cloud.google.com/go/compute/metadata v0.5.1 // indirect
7879
cloud.google.com/go/iam v1.2.0 // indirect
7980
cloud.google.com/go/storage v1.43.0 // indirect
8081
dario.cat/mergo v1.0.1 // indirect
@@ -118,17 +119,17 @@ require (
118119
github.com/ashanbrown/forbidigo v1.6.0 // indirect
119120
github.com/ashanbrown/makezero v1.1.1 // indirect
120121
github.com/aws/aws-sdk-go v1.54.6 // indirect
121-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13 // indirect
122-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 // indirect
123-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17 // indirect
122+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14 // indirect
123+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18 // indirect
124+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18 // indirect
124125
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
125-
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect
126-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 // indirect
126+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.5 // indirect
127+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20 // indirect
127128
github.com/aws/aws-sdk-go-v2/service/s3 v1.55.1 // indirect
128-
github.com/aws/aws-sdk-go-v2/service/sso v1.22.7 // indirect
129-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7 // indirect
130-
github.com/aws/aws-sdk-go-v2/service/sts v1.30.7 // indirect
131-
github.com/aws/smithy-go v1.20.4 // indirect
129+
github.com/aws/aws-sdk-go-v2/service/sso v1.23.0 // indirect
130+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.0 // indirect
131+
github.com/aws/aws-sdk-go-v2/service/sts v1.31.0 // indirect
132+
github.com/aws/smithy-go v1.21.0 // indirect
132133
github.com/beorn7/perks v1.0.1 // indirect
133134
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
134135
github.com/bkielbasa/cyclop v1.2.1 // indirect
@@ -173,7 +174,7 @@ require (
173174
github.com/docker/go-connections v0.5.0 // indirect
174175
github.com/docker/go-metrics v0.0.1 // indirect
175176
github.com/docker/go-units v0.5.0 // indirect
176-
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
177+
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
177178
github.com/emirpasic/gods v1.18.1 // indirect
178179
github.com/ettle/strcase v0.2.0 // indirect
179180
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
@@ -236,11 +237,11 @@ require (
236237
github.com/google/s2a-go v0.1.8 // indirect
237238
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
238239
github.com/google/uuid v1.6.0 // indirect
239-
github.com/googleapis/enterprise-certificate-proxy v0.3.3 // indirect
240+
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
240241
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
241242
github.com/gordonklaus/ineffassign v0.1.0 // indirect
242243
github.com/gorilla/mux v1.8.1 // indirect
243-
github.com/gorilla/websocket v1.5.0 // indirect
244+
github.com/gorilla/websocket v1.5.1 // indirect
244245
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
245246
github.com/gostaticanalysis/comment v1.4.2 // indirect
246247
github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect
@@ -255,7 +256,7 @@ require (
255256
github.com/hashicorp/go-uuid v1.0.3 // indirect
256257
github.com/hashicorp/go-version v1.7.0 // indirect
257258
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
258-
github.com/hashicorp/hcl v1.0.0 // indirect
259+
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
259260
github.com/hashicorp/hcl/v2 v2.20.1 // indirect
260261
github.com/hexops/gotextdiff v1.0.3 // indirect
261262
github.com/huandu/xstrings v1.5.0 // indirect
@@ -268,7 +269,7 @@ require (
268269
github.com/jinzhu/copier v0.3.5 // indirect
269270
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect
270271
github.com/jjti/go-spancheck v0.6.2 // indirect
271-
github.com/jmespath/go-jmespath v0.4.0 // indirect
272+
github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24 // indirect
272273
github.com/jmoiron/sqlx v1.4.0 // indirect
273274
github.com/jonboulle/clockwork v0.2.2 // indirect
274275
github.com/josharian/intern v1.0.0 // indirect
@@ -386,7 +387,7 @@ require (
386387
github.com/spyzhov/ajson v0.9.1 // indirect
387388
github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect
388389
github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect
389-
github.com/stoewer/go-strcase v1.2.0 // indirect
390+
github.com/stoewer/go-strcase v1.3.0 // indirect
390391
github.com/stretchr/objx v0.5.2 // indirect
391392
github.com/subosito/gotenv v1.6.0 // indirect
392393
github.com/tchap/go-patricia/v2 v2.3.1 // indirect
@@ -434,7 +435,7 @@ require (
434435
golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect
435436
golang.org/x/mod v0.21.0 // indirect
436437
golang.org/x/net v0.33.0 // indirect
437-
golang.org/x/oauth2 v0.22.0 // indirect
438+
golang.org/x/oauth2 v0.23.0 // indirect
438439
golang.org/x/sync v0.10.0 // indirect
439440
golang.org/x/sys v0.28.0 // indirect
440441
golang.org/x/term v0.27.0 // indirect
@@ -443,11 +444,11 @@ require (
443444
golang.org/x/tools v0.25.0 // indirect
444445
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
445446
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
446-
google.golang.org/api v0.196.0 // indirect
447+
google.golang.org/api v0.198.0 // indirect
447448
google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect
448449
google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect
449450
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
450-
google.golang.org/grpc v1.66.0 // indirect
451+
google.golang.org/grpc v1.66.2 // indirect
451452
google.golang.org/protobuf v1.34.2 // indirect
452453
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
453454
gopkg.in/inf.v0 v0.9.1 // indirect
@@ -457,11 +458,12 @@ require (
457458
honnef.co/go/tools v0.5.1 // indirect
458459
k8s.io/apiserver v0.31.1 // indirect
459460
k8s.io/component-base v0.31.1 // indirect
460-
k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f // indirect
461+
k8s.io/kube-openapi v0.0.0-20240903163716-9e1beecbcb38 // indirect
461462
mvdan.cc/gofumpt v0.7.0 // indirect
462463
mvdan.cc/sh/v3 v3.8.0 // indirect
463464
mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f // indirect
464465
oras.land/oras-go v1.2.5 // indirect
466+
sigs.k8s.io/gateway-api v1.1.0 // indirect
465467
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
466468
sigs.k8s.io/kustomize/api v0.17.3 // indirect
467469
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect

0 commit comments

Comments
 (0)