openservicemesh / osm

Open Service Mesh (OSM) is a lightweight, extensible, cloud native service mesh that allows users to uniformly manage, secure, and get out-of-the-box observability features for highly dynamic microservice environments.
https://openservicemesh.io/
Apache License 2.0
2.59k stars 277 forks source link

k8s/events: detect Secret kind #5200

Closed shashankram closed 2 years ago

shashankram commented 2 years ago

Description: Secret events were ignored, leading to error logs when Secret events are received. This allows the controller to correctly process the event.

Testing done: Without this change, the follow error logs are observed:

{"level":"error","component":"kube-events","time":"2022-10-12T18:36:13Z","file":"types.go:196","message":"Unknown kind: &Secret{ObjectMeta:{envoy-bootstrap-config-e18ceb59-6184-4215-9097-1e32ce86bfc6  httpbin  11b77a82-9cad-40e3-9903-c5b25e01f0f6 49248 0 2022-10-12 18:36:13 +0000 UTC <nil> <nil> map[app.kubernetes.io/instance:osm app.kubernetes.io/name:openservicemesh.io app.kubernetes.io/version:dev] map[] [] []  [{osm-injector Update v1 2022-10-12 18:36:13 +0000 UTC FieldsV1 {\"f:data\":{\".\":{},\"f:bootstrap.yaml\":{},\"f:cacert.pem\":{},\"f:sds_cert.pem\":{},\"f:sds_key.pem\":{},\"f:signing_issuer_id\":{},\"f:tls_certificate_sds_secret.yaml\":{},\"f:validating_issuer_id\":{},\"f:validation_context_sds_secret.yaml\":{}},\"f:metadata\":{\"f:labels\":{\".\":{},\"f:app.kubernetes.io/instance\":{},\"f:app.kubernetes.io/name\":{},\"f:app.kubernetes.io/version\":{}}},\"f:type\":{}} }]},Data:map[string][]byte{bootstrap.yaml: ...
Affected area: Functional Area
Control Plane [X]

Please answer the following questions with yes/no.

  1. Does this change contain code from or inspired by another project? no

    • Did you notify the maintainers and provide attribution?
  2. Is this a breaking change? no

  3. Has documentation corresponding to this change been updated in the osm-docs repo (if applicable)? n/a

codecov-commenter commented 2 years ago

Codecov Report

Merging #5200 (8c42606) into main (88af2f1) will decrease coverage by 0.00%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #5200      +/-   ##
==========================================
- Coverage   66.92%   66.91%   -0.01%     
==========================================
  Files         200      200              
  Lines       16379    16381       +2     
==========================================
  Hits        10961    10961              
- Misses       5365     5367       +2     
  Partials       53       53              
Flag Coverage Δ
unittests 66.91% <0.00%> (-0.01%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/k8s/events/types.go 64.15% <0.00%> (-2.52%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

keithmattix commented 2 years ago

Should this change be backported? How long has this behavior existed?

steeling commented 2 years ago

Should this change be backported? How long has this behavior existed?

Secrets just got added recently for rotating bootstrap certs