mirror of
https://github.com/docker/docs.git
synced 2026-11-05 00:14:17 +03:00
need a passthrough bootstrap on TufMetaStore
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
This commit is contained in:
committed by
Riyaz Faizullabhoy
parent
227092b942
commit
33f5255c8d
@@ -9,6 +9,9 @@ import (
|
||||
|
||||
func bootstrap(ctx context.Context) error {
|
||||
s := ctx.Value("metaStore")
|
||||
if s == nil {
|
||||
return fmt.Errorf("no store set during bootstrapping")
|
||||
}
|
||||
store, ok := s.(storage.Bootstrapper)
|
||||
if !ok {
|
||||
return fmt.Errorf("Store does not support bootstrapping.")
|
||||
|
||||
@@ -64,7 +64,9 @@ func main() {
|
||||
err = server.Run(ctx, serverConfig)
|
||||
}
|
||||
|
||||
logrus.Error(err.Error())
|
||||
if err != nil {
|
||||
logrus.Fatal(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ echo "trying to contact RethinkDB for 30 seconds before failing"
|
||||
case $SERVICE_NAME in
|
||||
notary_server)
|
||||
# have to poll for DB to come up
|
||||
until notary-server -config=fixtures/server-config.rethink.json -bootstrap > /dev/null
|
||||
until notary-server -config=fixtures/server-config.rethink.json -bootstrap
|
||||
do
|
||||
((iter++))
|
||||
if (( iter > 30 )); then
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/docker/go/canonical/json"
|
||||
"github.com/docker/notary"
|
||||
"github.com/docker/notary/storage"
|
||||
"github.com/docker/notary/tuf/data"
|
||||
)
|
||||
|
||||
@@ -104,3 +105,10 @@ func (tms TufMetaStorage) GetCurrent(gun, tufRole string) (*time.Time, []byte, e
|
||||
tms.cachedMeta[roleSha256Hex] = &storedMeta{data: roleJSON, createupdate: roleTime}
|
||||
return roleTime, roleJSON, nil
|
||||
}
|
||||
|
||||
func (tms TufMetaStorage) Bootstrap() error {
|
||||
if s, ok := tms.MetaStore.(storage.Bootstrapper); ok {
|
||||
return s.Bootstrap()
|
||||
}
|
||||
return fmt.Errorf("store does not support bootstrapping")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user