-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat: add MTLS.permissiveMetrics to optionally enable Istio permissive mo… #889
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great addition!
Thanks for your contribution!
Added a single comment :)
@@ -78,6 +78,14 @@ func (b *PeerAuthenticationBuilder) Update(object client.Object) error { | |||
}, | |||
} | |||
|
|||
if b.instance.Spec.Metrics.IsEnabled() && b.instance.Spec.MTLS.PermitMetrics { | |||
pa.Spec.PortLevelMtls = map[uint32]*istioapisecurityv1beta1.PeerAuthentication_MutualTLS{ | |||
uint32(*b.instance.Spec.Metrics.Prometheus.ListenPort): { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here both b.instance.Spec.Metrics.Prometheus
and b.instance.Spec.Metrics.Prometheus.ListenPort
can be nil.
So you have to test this before dereferencing the pointer.
(Even if defaulted by: https://github.com/alexandrevilain/temporal-operator/blob/main/api/v1beta1/temporalcluster_defaults.go#L247)
if b.instance.Spec.Metrics.Prometheus != nil && b.instance.Spec.Metrics.Prometheus.ListenPort != nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much for explaining. I will update that.
(I was assuming that that https://github.com/alexandrevilain/temporal-operator/blob/main/api/v1beta1/temporalcluster_defaults.go#L247 would have initialized those pointers already but admittedly I didn't check.
Before merging, could you plase squash your commits ? :) |
…de on the metrics port
|
Thanks very much again. I've squashed my commits |
…de on the metrics port
This fixes issue #888