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

ConfigExceptions aren't made visible #2219

Open
merval opened this issue Apr 12, 2024 · 3 comments
Open

ConfigExceptions aren't made visible #2219

merval opened this issue Apr 12, 2024 · 3 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@merval
Copy link

merval commented Apr 12, 2024

What is the feature and why do you need it:
When loading the kube config, if any ConfigException is thrown it's caught and simply printed as an error message. This prevents any action being taken by the user when the exception is thrown. It also doesn't halt the application, which causes cascading errors.

Describe the solution you'd like to see:
Very simple fix:

except Exception as e:
logging.error(str(e))

Should be:

except ConfigException as e:
    raise ConfigException(e)
except Exception as e:
    logging.error(str(e))
@merval merval added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 12, 2024
@roycaihw
Copy link
Member

The behavior is specific to exec plugin and was introduced in kubernetes-client/python-base#75. Here is some context: kubernetes-client/python-base#75 (comment). The reason was to give a chance to other auth methods.

@yliaog Do you have concerns with the proposal?

If we change the behavior, we should document it in the release notes in case people are depending on the behavior.

@yliaog
Copy link
Contributor

yliaog commented Apr 24, 2024

I think the reason (give a chance to other auth methods) is still valid, what do you think @merval ?

@merval
Copy link
Author

merval commented Apr 24, 2024

Yeah, that seems valid. In my case the ConfigException is thrown because the token is expired. I wonder of there should be a mechanism to raise the ConfigException if all other authentication methods fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants