mirror of
https://github.com/distribution/distribution.git
synced 2025-09-20 10:47:26 +00:00
version: export getter functions
Future-proof the version package's exported interface by only making the data available through getter functions. This affords us the flexibility to e.g. implement them in terms of "runtime/debug".ReadBuildInfo() in the future. Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
@@ -114,7 +114,7 @@ func NewApp(ctx context.Context, config *configuration.Configuration) *App {
|
||||
storageParams = make(configuration.Parameters)
|
||||
}
|
||||
if storageParams["useragent"] == "" {
|
||||
storageParams["useragent"] = fmt.Sprintf("distribution/%s %s", version.Version, runtime.Version())
|
||||
storageParams["useragent"] = fmt.Sprintf("distribution/%s %s", version.Version(), runtime.Version())
|
||||
}
|
||||
|
||||
var err error
|
||||
|
@@ -99,7 +99,7 @@ var ServeCmd = &cobra.Command{
|
||||
Long: "`serve` stores and distributes Docker images.",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
// setup context
|
||||
ctx := dcontext.WithVersion(dcontext.Background(), version.Version)
|
||||
ctx := dcontext.WithVersion(dcontext.Background(), version.Version())
|
||||
|
||||
config, err := resolveConfiguration(args)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user