smallstep / helm-charts

Helm packages for Kubernetes
Apache License 2.0
49 stars 72 forks source link

helm test fails for smallstep/step-certificates #149

Closed msardara closed 1 year ago

msardara commented 1 year ago

Subject of the issue

Test of smallstep/step-certificates does not work.

Your environment

Steps to reproduce

$ helm repo add smallstep https://smallstep.github.io/helm-charts/
$ helm install my-release smallstep/step-certificates
$ helm test my-release
NAME: my-release
LAST DEPLOYED: Fri Aug  4 09:40:16 2023
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE:     my-release-step-certificates-test-connection
Last Started:   Fri Aug  4 09:40:27 2023
Last Completed: Fri Aug  4 09:40:31 2023
Phase:          Failed
NOTES:
Thanks for installing Step CA.

1. Get the PKI and Provisioner secrets running these commands:
   kubectl get -n default -o jsonpath='{.data.password}' secret/my-release-step-certificates-ca-password | base64 --decode
   kubectl get -n default -o jsonpath='{.data.password}' secret/my-release-step-certificates-provisioner-password | base64 --decode
2. Get the CA URL and the root certificate fingerprint running this command:
   kubectl -n default logs job.batch/my-release

3. Delete the configuration job running this command:
   kubectl -n default delete job.batch/my-release
Error: pod my-release-step-certificates-test-connection failed

$ k logs my-release-step-certificates-test-connection
Connecting to my-release-step-certificates:443 (10.96.30.54:443)
wget: server returned error: HTTP/1.0 400 Bad Request

Expected behaviour

Test should succeed

Actual behaviour

Test constantly fails

Additional context

This may be an issue when step-certificates is used as subchart of a chart that runs helm test.

maraino commented 1 year ago

Thanks @msardara. I think it was using HTTP instead of HTTPS by default. I've changed to HTTPS, but it was still failing because the wget in Busibox is not compiled with TLS support or does not support TLS 1.2. So finally, I changed the test to use alpine/curl in PR #150

msardara commented 1 year ago

Thanks a lot @maraino!