Skip to content
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

Not possible to use namespaceSupplier without namespace on @Informer with DefaultInformerNamespaceResolver #508

Open
mborst opened this issue Aug 15, 2022 · 0 comments
Labels
type: bug Something isn't working

Comments

@mborst
Copy link

mborst commented Aug 15, 2022

Expected Behavior

I would like to specify a namespacesSupplier as the only source of a namespace that an @Informer uses for watching with the current DefaultInformerNamespaceResolver.

Actual Behaviour

The current logic of DefaultInformerNamespaceResolver[1] does always add the literal string RESOLVE_AUTOMATICALLY as an actual namespace if only namespaceSupplier is provided, and it is not possible to provide a namespaceSupplier and ignore whatever it is that namespace is set to (tried "" for example).

[1] https://github.com/micronaut-projects/micronaut-kubernetes/blob/master/kubernetes-informer/src/main/java/io/micronaut/kubernetes/client/informer/resolvers/DefaultInformerNamespaceResolver.java#L92-L104

Steps To Reproduce

  1. In a k8s environment
  2. With any namespaceSupplier that provides an array of namespaces
  3. Run with TRACE logging enabled.
  4. See the following logs:
{
  "@timestamp": "2022-08-15T18:50:05.642Z",
  "@version": "1",
  "message": "Namespace: [the-correct-namespace]",
  "logger_name": "io.micronaut.kubernetes.client.DefaultNamespaceResolver",
  "thread_name": "main",
  "level": "DEBUG",
  "level_value": 10000,
}
[...]
{
  "@timestamp": "2022-08-15T18:50:12.879Z",
  "@version": "1",
  "message": "<-- 403  https://10.129.144.1/apis/apps/v1/namespaces/RESOLVE_AUTOMATICALLY/statefulsets?labelSelector=DOESNOTMATTER&resourceVersion=8955394387&timeoutSeconds=496&watch=true 369-byte",
  "logger_name": "io.micronaut.kubernetes.client.OkHttpClientLogging",
  "thread_name": "controller-reflector-io.kubernetes.client.openapi.models.V1StatefulSet-1",
  "level": "TRACE",
  "level_value": 5000
}

Environment Information

  • OS: Linux
  • JDK17.0.2

Example Application

No response

Version

3.5.3

@alvarosanchez alvarosanchez added the type: bug Something isn't working label Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants