Skip to content

Conversation

@AnthonyWC
Copy link

SUMMARY

Add warn for resorce missing kind field

ISSUE TYPE

Currently k8s_cluster_info.py just assume kind field will always exists; this helps to warn/debug issue when resource is missing kind field

@softwarefactory-project-zuul
Copy link

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you found a particular case where there's an error? As far as I'm aware this shouldn't be necessary. The check should already be happening in https://github.com/kubernetes-client/python/blob/07fb11f2bc6a6356854e9dabcd7d65a62e849feb/kubernetes/base/dynamic/resource.py#L29

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes; specifically i ran into this while using kiali-operator: https://github.com/kiali/kiali-operator/blob/master/roles/default/kiali-deploy/tasks/main.yml#L23

But i imagine it's generally a good idea to check/warn for exception as it is used in many places. In general, cluster api should almost always have kind field but for whatever reason I have one k8 cluster where it failed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you reproduce the error? I'm not opposed to adding a check if it's necessary, but it doesn't look to me like your change would fix that problem.

Copy link
Author

@AnthonyWC AnthonyWC Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My change isn't meant to fix the error but to warn on which resource caused the error. The fix should be applied on kubernetes api side (on specific resource).

@yurnov yurnov mentioned this pull request Dec 10, 2024
32 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants