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

Provide detailed error for removed apiVersions #809

Merged
merged 5 commits into from
Sep 19, 2019

Conversation

lblackstone
Copy link
Member

Proposed changes

Before creating any resource, check if the requested apiVersion
has been deprecated/removed on the targeted version of k8s,
and print a detailed error message if so. This should avoid
confusion from users who try to use unsupported versions.

Screen Shot 2019-09-17 at 5 15 29 PM

Related issues (optional)

@lblackstone
Copy link
Member Author

lblackstone commented Sep 17, 2019

I'm still in the process of unifying the ServerVersion usage, but this draft shows the expected output when a user tries to create an unsupported apiVersion of a resource on k8s 1.16.

This is now RFR

@lblackstone lblackstone marked this pull request as ready for review September 18, 2019 16:00
Copy link
Contributor

@metral metral left a comment

Choose a reason for hiding this comment

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

Overall LGTM.

Is there a reason in the OP image that we're both warning && error'ing with the same message?

I'd imagine they'd be mutually exclusive, as a warning is a heads-up with no action required but is suggested, and an error is a true failure. As presented, I'd expect to only see an error that I'd have to fix because I'm using an unsupported group/version.

Thoughts?

pkg/kinds/deprecated_test.go Outdated Show resolved Hide resolved
Before creating any resource, check if the requested apiVersion
has been deprecated/removed on the targeted version of k8s,
and print a detailed error message if so. This should avoid
confusion from users who try to use unsupported versions.
@lblackstone
Copy link
Member Author

Is there a reason in the OP image that we're both warning && error'ing with the same message?

No, not a good reason. I'll make it mutually exclusive.

@lblackstone
Copy link
Member Author

lblackstone commented Sep 19, 2019

Here's what it looks like after the update on a 1.16 cluster.

Screen Shot 2019-09-19 at 11 34 05 AM

@metral
Copy link
Contributor

metral commented Sep 19, 2019

Looks great.

nit: Can we link to the official k8s API docs as part of the message so that users can check them out if necessary?

e.g. https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16

@lblackstone
Copy link
Member Author

Updated with docs link:

Screen Shot 2019-09-19 at 11 53 23 AM

@lblackstone lblackstone merged commit a28147b into master Sep 19, 2019
@pulumi-bot pulumi-bot deleted the lblackstone/missing-api-error branch September 19, 2019 18:22
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.

None yet

2 participants