kptdev / kpt

Automate Kubernetes Configuration Editing
https://kpt.dev
Apache License 2.0
1.7k stars 228 forks source link

Improve error message if docker daemon is not available/running #1859

Open mortent opened 3 years ago

mortent commented 3 years ago

Expected behavior

An error message that makes it clear what the problem is.

Actual behavior

If the daemon isn't running, I get the following error message:

$ kpt fn render
Package "mysql": 

[RUNNING] "gcr.io/kpt-fn/apply-setters:v0.1"
[FAIL] "gcr.io/kpt-fn/apply-setters:v0.1"
fn.render: pkg .:
    pkg.render: pkg mysql:
    pipeline.run: failed to check function image existence: failed to check local function image "gcr.io/kpt-fn/apply-setters:v0.1": exit status 1 

Is there a way we can check the status of docker before we run the pipeline?

Shell32-Natsu commented 3 years ago

kpt requires git and docker. May be we can check the requirements at the beginning of the command?

And for this particular error, we will defined an error struct for it.