carvel-dev / kapp

kapp is a simple deployment tool focused on the concept of "Kubernetes application" — a set of resources with the same label

Home Page:https://carvel.dev/kapp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cleanup: preflight checks

praveenrewar opened this issue · comments

Recently we have introduced the preflight flag in kapp and also added a couple of checks. This issue tracks a few of the items that we didn't cover during the reviews and it would be good to do some clean up.

  • Package name for test files should be *_test (registry_test.go)
  • Remove the usages of RemoveClusterResource in tests that are no longer required (example)
  • In Carvel, we capitalise first character of error messages along with colons, this is used in the ui library to help with printing multiline error messages. We should aim to keep the error format consistent (example of how the error looks like with indentation)
  • In some scenarios, there might be more than one errors that we want to report, we use semi structured error to ensure that each individual error gets it's own line making the overall error more clear. (example of how such an error message looks like)
  • We seem to be adding a lot of e2e tests for preflight checks (which is good). Currently all these tests are in the test/e2e directory and most of them have a dedicated file (which is also good as # of lines per file are less). Should we move them to a dedicated directory like test/e2e/preflights so that the other e2e tests are not overshadowed by preflight checks?
  • Fix handled() function for some of the validators (details)

@everettraven Let me know if this looks good.

Looks great, thanks for writing this up!

As a part of this issue, we also need to address this particular review comment for all the instances where we return handled() so that empty values are not returned for the diff objects.