linuxkit / kubernetes

minimal and immutable Kubernetes images built with LinuxKit
Apache License 2.0
400 stars 75 forks source link

git checkout quietly #43

Closed errordeveloper closed 6 years ago

errordeveloper commented 6 years ago

This gets rid of big red message in the build output.

ijc commented 6 years ago

read

red?

ijc commented 6 years ago

Why only this one checkout? Are the others not noisy/red too?

errordeveloper commented 6 years ago

@ijc clone is also red, but I see only two lines, and it seems inappropriate to completely silence it, as you might want to see output if it fails (which is less unlikely)...

errordeveloper commented 6 years ago

Also, I just noticed that our method results in -dirty appended to the version string, i.e.:

> docker run -ti --entrypoint /usr/bin/kubelet linuxkit/kubelet:ea4a24907759efb729784fe5b50c3dc88feb046d --version
Kubernetes v1.9.0-dirty

I think that git checkout -q $REV -b build could fix this, but will have to test it out... I think it's an important detail, users might get an impression that the code had been patched.

ijc commented 6 years ago

I meant all the other git checkouts, there is at least cni and critools in addition to kube itself in this Dockerfile.

ijc commented 6 years ago

I don't think -q suppresses the error messages:

$ git clone -q http://notathing/notarepo
fatal: unable to access 'http://notathing/notarepo/': Could not resolve host: notathing

Although maybe there would have been useful non-error messages before that point in some cases.

Perhaps 2>&1 without using -q is the right answer? Assuming git can be trusted to exit with an error code on an error and we use set -e where necessary.

The -dirty thing is odd -- are you sure that is not a preexisting issue?

errordeveloper commented 6 years ago

...there is at least cni and critools in addition to kube itself in this Dockerfile.

Ah, yes. I've done cni, but missed critools, will update.

ijc commented 6 years ago

Looks like -dirty is a preexisting condition:

$ docker run -ti --entrypoint /usr/bin/kubelet linuxkit/kubelet:03205e3daddfeedeb64d4e023b42c225c8e00945 --version
Unable to find image 'linuxkit/kubelet:03205e3daddfeedeb64d4e023b42c225c8e00945' locally
03205e3daddfeedeb64d4e023b42c225c8e00945: Pulling from linuxkit/kubelet
1ed3bb82ce05: Pull complete 
Digest: sha256:0f442097dcd90c1e46e5a90c68a2a7ea7173d451e2d4e8b81d18742903106d77
Status: Downloaded newer image for linuxkit/kubelet:03205e3daddfeedeb64d4e023b42c225c8e00945
Kubernetes v1.9.0-dirty
errordeveloper commented 6 years ago

Looks like -dirty is a preexisting condition...

It is indeed – I didn't mean it was new, just thought I'd look into it while at it.

ijc commented 6 years ago

https://github.com/linuxkit/kubernetes/issues/44 now covers the -dirty.

errordeveloper commented 6 years ago

@ijc thanks, will deal with that separately.

errordeveloper commented 6 years ago

Perhaps 2>&1 without using -q is the right answer? Assuming git can be trusted to exit with an error code on an error and we use set -e where necessary.

I think -q is okay for checkouts, but not sure about clone. I'd leave that for now, I'm quite happy we don't get a line for each progress update 🤣

ijc commented 6 years ago

LGTM but will need a rebase.