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

data.kubernetes_nodes should include annotations #2336

Closed
hcsaustrup opened this issue Nov 2, 2023 · 4 comments · Fixed by #2345
Closed

data.kubernetes_nodes should include annotations #2336

hcsaustrup opened this issue Nov 2, 2023 · 4 comments · Fixed by #2345

Comments

@hcsaustrup
Copy link

Description

Please consider returning annotations in the kubernetes_nodes data source. Currently annotations are returned, but always as an empty object ({}).

@arybolovlev
Copy link
Contributor

Hi @hcsaustrup,

Thank you for reporting this issue. I was able to reproduce it and isolate a piece of code where it happens.

I am going to bring this up during our triage session so we can evaluate this issue.

Thanks!

@arybolovlev
Copy link
Contributor

To add a bit more context here.

  • There is a function flattenMetadata that covers multiple use cases when it comes to flattening received metadata.
  • This function aims to cover two use cases -- (1) regular Kubernetes object, when we cut out any labels and annotations whose key names end with kubernetes.io(more information in out documentation here), (2) object templates, when we don't cut out any labels and annotations.
  • Due to the nature of the kubernetes_nodes data source(here we pass a prefix), it falls under the second scenario, but it covers only object templates and thus fails for the discussed data source.

We need to refactor the flattenMetadata function and basically split in into smaller functions to cover different scenarios.

@arybolovlev
Copy link
Contributor

@hcsaustrup, in your case, do you expect to see all annotations and labels in this data source or cutting out kubernetes.io ones sounds right?

@hcsaustrup
Copy link
Author

I'm primarily looking for custom annotations and labels we added ourselves - but if it's not a problem, it would be nice to have all of them available, just in case.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants