-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Track default SSL cert if TLS.SecretName is empty #611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@jcmoraisjr why? By doing this you are always adding a secret to the tls section which is not correct. |
This code add the secret to the secret tracker. It is iterating the spec.tls slice with host(s) and an optional secretName field. If the field is empty, the correct behaviour is to use the default secret. |
@jcmoraisjr secretTracker contains information about valid secrets that exist in the cluster. If some secret is missing we cannot replace it with the default or self generated by the controller. |
An empty I just updated this branch checking if the secret of the default cert was provided. If so and |
secretTracker must contain only valid secrets, not the default and never overwrite secret information. |
Let me know what I didn't understand and sorry if I missed something. What I want to see working is leave secretName optional and this will assign the default TLS cert for me. This is already working: if TLS[].secretName is empty, the default cert is being used on TLS connections. What I want to fix is a misbehaviour when I try to use this approach. Note: everything is working but ingress is complaining every 10s that How I want to fix: if secretName is empty and ingress is started with a secret name that points to a valid TLS cert, this secret name is tracked instead - so I can hot-swap the default TLS cert. But if for some reason (if so please let me know why and I'll learn a bit more) a secret name used in |
@jcmoraisjr right, now I understand what you are trying to do. Why not just check for empty string and continue? Like: if tls.SecretName == "" {
continue
} |
Because if I track the secret of the default TLS cert I can update it without restarting the controller. |
@aledbf Any news on this PR? |
@jcmoraisjr here is my wip to remove the sync loop #690 |
This PR fixes
secret not found
warning and correctly track default SSL cert if Ingress'TLS.SecretName
is empty.