Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Improve user-friendliness of object_factory #26

Merged
merged 4 commits into from
Jul 1, 2019

Conversation

thilp
Copy link

@thilp thilp commented Jun 20, 2019

Fix #25.

  • Raise ValueError with a higher-level message when using object_factory with a kind that does not exist in the cluster.
  • Use the occasion to add a type annotation on the return value of object_factory so that smart editors (e.g. PyCharm) are still able to autocomplete on the generated types.
  • Fix test_from_default_kubeconfig so that it takes the KUBECONFIG env variable into account. Otherwise, the test was failing locally on my machine because KUBECONFIG is defined and points to something else than ~/.kube/config.

@thilp thilp force-pushed the better-crd-error branch from bb33880 to 5fee74c Compare June 20, 2019 09:34
thilp added 4 commits June 20, 2019 14:52
This allows annotation-aware editors like PyCharm to offer relevant code
completion like filter and get_*.
My KUBECONFIG env variable is set to something different, so this test
fails because it compares a hardcoded path to the user's environment.
@thilp thilp force-pushed the better-crd-error branch from 5fee74c to bee6abe Compare June 20, 2019 12:52
@thilp
Copy link
Author

thilp commented Jul 1, 2019

@hjacobs What do you think?

@hjacobs
Copy link
Owner

hjacobs commented Jul 1, 2019

Sorry I overlooked this PR, LGTM.

@hjacobs hjacobs merged commit 9b548c9 into hjacobs:master Jul 1, 2019
@thilp thilp deleted the better-crd-error branch July 1, 2019 22:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Obscure error and stdout I/O in object_factory with CRDs
2 participants