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

fix(kubernetes): properly handle diff namespaces #237

Merged
merged 7 commits into from
Mar 17, 2020
Merged

Conversation

sh0rez
Copy link
Member

@sh0rez sh0rez commented Mar 16, 2020

Supersedes #224 with a approach that I consider more proper:

  1. Cluster-wide resources are always checked with the running cluster
  2. If a namespace is missing but will be created in the same run, report is as created
  3. Everything else is checked with the running cluster.

This is probably a good way because:

  • Fully absent namespaces are still noticed at apply
  • The common case of namespace missing, but soon existing is covered

In the future, this can be easily extended to handle CRD's as well, because the list of known resources is already queried from the cluster (thanks @mplzik for the idea).

Adds a method to the client to query all known api-resources from the server
Previous commit added support for separating resources in groups. This
commit uses these new groups to provide a better diff experience.

Especially a soon-created namespace won't cause an error anymore.
The tested code is superseded by other tested code, we don't need that
anymore
@sh0rez sh0rez requested review from rfratto and mplzik March 16, 2020 17:37
@sh0rez sh0rez added component/kubernetes Working with Kubernetes clusters kind/bug Something isn't working labels Mar 16, 2020
Adds a unit test to ensure UnmarshalTable behaves properly. Also
modified the behaviour a bit for correctness.
Copy link
Member

@rfratto rfratto left a comment

Choose a reason for hiding this comment

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

LGTM although you might want to wait for a review from someone who is more familiar with this

@malcolmholmes malcolmholmes self-requested a review March 17, 2020 13:51
@sh0rez sh0rez merged commit 3371845 into master Mar 17, 2020
@sh0rez sh0rez deleted the apiresources branch March 17, 2020 16:27
Copy link
Contributor

@mplzik mplzik left a comment

Choose a reason for hiding this comment

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

Nice PR; apologies for late review. :)

@sh0rez sh0rez mentioned this pull request Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/kubernetes Working with Kubernetes clusters kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants