Repository navigation
docker version reports the engine's commit and build time - #33
Merged
Merged
Conversation
/version said GitCommit "preview" with no build time, so docker version could not tell engine builds apart. go build already records the commit (vcs.revision, vcs.time, vcs.modified); dockivad now reports it: the first 12 characters of the commit, "-dirty" for uncommitted changes, and the commit's time as BuildTime. It also returns an "Engine" component with those details, as dockerd does, so docker version's Engine section shows the Go version, commit and build time instead of blanks. A build outside a git checkout reports "unknown".
verify_dockivad.py identifies the Go control plane by Components[0].
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
docker versioncouldn't tell engine builds apart./versionreturnedGitCommit "preview", no build time, and only adockivadcomponent, so the CLI's Engine section showed blank Go version, commit and build date:Fix
go buildalready records the commit in the binary (vcs.revision,vcs.time,vcs.modified); the shipped v0.6.9dockivadcarriesaf13b2b.dockivad/api.gonow reads it withdebug.ReadBuildInfo:GitCommit: the first 12 characters of the commit, with-dirtyfor uncommitted changes. A build outside a git checkout reportsunknown.BuildTime: the commit's time, so a rebuild of the same commit reports the same value.Enginecomponent with those details, as dockerd returns.dockivadstays the first component, becauseverify_dockivad.pychecksComponents[0].No build script change.
Versionstays0.18.0and the API version stays 1.45.Tested
go test -race ./...indockivad: ok.TestAPIContractAndRejectedOptionsnow checks the commit and both components.bundle_dockiva_engine.py:verify_dockivad.py --new-home31/31.docker versionagainst that bundle's engine: