You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
namespace is nullchecked, but then the nil value is reused in string(*alp.Spec.TargetRef.Namespace)
I looked at all other objects and it seems that they do not require the operator to specify target ref namespace. I'm wondering why in this accesslogpolicy we require target ref namespace instead of just defaulting it to the access log policy's namespace if it's missing. This is also the only place that uses k8s.NamespaceOrDefault for now.
I would make a contribution to fix this but I'm not sure if the maintainers would prefer
for this NPE to be fixed by not referencing the nil in the log
or for the default namespace to be assumed
The text was updated successfully, but these errors were encountered:
When the namespace isn't present, I think it would be better to use the namespace of the access log policy rather than "default" as the code implies above. I think the AccessLogPolicy CRD even documents this behaviour.
using this sample accesslogpolicy
aws-application-networking-k8s/docs/api-types/access-log-policy.md
Lines 37 to 47 in 086bcb0
results in an NPE
this is because in the controller:
aws-application-networking-k8s/pkg/controllers/accesslogpolicy_controller.go
Lines 177 to 183 in 086bcb0
namespace is nullchecked, but then the nil value is reused in
string(*alp.Spec.TargetRef.Namespace)
I looked at all other objects and it seems that they do not require the operator to specify target ref namespace. I'm wondering why in this accesslogpolicy we require target ref namespace instead of just defaulting it to the access log policy's namespace if it's missing. This is also the only place that uses
k8s.NamespaceOrDefault
for now.I would make a contribution to fix this but I'm not sure if the maintainers would prefer
The text was updated successfully, but these errors were encountered: