[kots]: add registry to preflight and support checks #11056
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds a preflight and support checks to KOTS. As with the storage and database, this uses a container for this job. This extends the storage check so that the S3 backend can be checked as well
This uses Heroku's Docker Registry Client to check the validity of the credentials. I've looked through the source code and, whilst it's not what we're using in the Image Builder, it's a much simpler structure than used elsewhere in the project. From what I could see, we'd have to write (and therefore maintain) a credential checker as I've not found that exact operation in our existing codebase. It does seem to work as expected for all the registries I've checked (Azure, GCP).
The GCP URLs add in a custom check to ensure that they're using the correct server address. This is two-fold:
gcr.io/project/repo
, but uses the credentials if ongcr.io
It's arguably a bit of a hacky approach (I'm open to suggestions), but it does work for our needs.
As with all the preflight checks, they don't prevent the user from deploying but are there to highlight whether it'll work or not. Whilst we shouldn't get any false negatives, the risk is low.
Related Issue(s)
Fixes #10337
How to test
Deploy to a cluster and run tests against the config prefligths
Release Notes
Documentation
Werft options: