openconfig / kne

Apache License 2.0
214 stars 64 forks source link

Add `x` directory and mutating webhook #524

Closed alexmasi closed 5 months ago

alexmasi commented 5 months ago

FYI: @chrisy

coveralls commented 5 months ago

Pull Request Test Coverage Report for Build 8531051848

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
x/webhook/examples/addcontainer/addcontainer.go 24 27 88.89%
x/webhook/mutate/mutate.go 19 23 82.61%
x/webhook/admission/admission.go 40 50 80.0%
<!-- Total: 83 100 83.0% -->
Totals Coverage Status
Change from base Build 8443080376: 0.3%
Covered Lines: 4571
Relevant Lines: 7009

💛 - Coveralls
chrisy commented 5 months ago

Yikes, this has grown into quite the submission! Thanks for making this available!

alexmasi commented 5 months ago

I think I'm close, just hanging during topo creation. Logs from the webhook below:

alexmasi@alexmasi:~/kne/x/webhook$ k logs -l app=kne-assembly-webhook
2024/03/28 23:37:49 http: TLS handshake error from 10.244.0.1:1318: remote error: tls: bad certificate
2024/03/28 23:37:49 http: TLS handshake error from 10.244.0.1:28769: remote error: tls: bad certificate
2024/03/28 23:37:49 http: TLS handshake error from 10.244.0.1:6189: remote error: tls: bad certificate
2024/03/28 23:37:49 http: TLS handshake error from 10.244.0.1:52484: remote error: tls: bad certificate

@alshabib have you seen something like this before when developing? The genCerts.sh script is not documented and I am probably missing something there

alshabib commented 5 months ago

How was the webhook started? Was the certificate yaml also loaded?

alexmasi commented 5 months ago

How was the webhook started? Was the certificate yaml also loaded?

The README describes the full process followed (which is an extension of the existing README internally)

alshabib commented 5 months ago

Ah yes sorry about that. When running genCerts.sh it updates tls.secret.yaml but not the mutating.config.yaml where you need to copy the updated caBundle outputting by genCerts.sh to into mutating.config.yaml.