mirror of
https://github.com/docker/docs.git
synced 2026-04-12 14:25:46 +07:00
fix for double init problem
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"server": {
|
||||
"addr": ":4443",
|
||||
"tls_cert_file": "fixtures/vetinari.pem",
|
||||
"tls_key_file": "fixtures/vetinari.key"
|
||||
"tls_cert_file": "../../fixtures/vetinari.pem",
|
||||
"tls_key_file": "../../fixtures/vetinari.key"
|
||||
},
|
||||
"trust_service":{
|
||||
"type": "local",
|
||||
|
||||
@@ -64,12 +64,19 @@ func AddHandler(ctx utils.Context, w http.ResponseWriter, r *http.Request) *erro
|
||||
Err: err,
|
||||
}
|
||||
}
|
||||
_ = tufRepo.Init(false)
|
||||
//err = tufRepo.Init(false)
|
||||
//if err != nil {
|
||||
// return &errors.HTTPError{
|
||||
// HTTPStatus: http.StatusInternalServerError,
|
||||
// Code: 9996,
|
||||
// Err: err,
|
||||
// }
|
||||
//}
|
||||
err = tufRepo.AddTarget(vars["tag"], json.RawMessage{})
|
||||
if err != nil {
|
||||
return &errors.HTTPError{
|
||||
HTTPStatus: http.StatusInternalServerError,
|
||||
Code: 9999,
|
||||
Code: 9997,
|
||||
Err: err,
|
||||
}
|
||||
}
|
||||
@@ -77,7 +84,7 @@ func AddHandler(ctx utils.Context, w http.ResponseWriter, r *http.Request) *erro
|
||||
if err != nil {
|
||||
return &errors.HTTPError{
|
||||
HTTPStatus: http.StatusInternalServerError,
|
||||
Code: 9999,
|
||||
Code: 9998,
|
||||
Err: err,
|
||||
}
|
||||
}
|
||||
@@ -184,6 +191,7 @@ func GenKeysHandler(ctx utils.Context, w http.ResponseWriter, r *http.Request) *
|
||||
Err: err,
|
||||
}
|
||||
}
|
||||
_ = tufRepo.Init(false)
|
||||
_, err = tufRepo.GenKey("root")
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
|
||||
Reference in New Issue
Block a user