1
0
mirror of https://github.com/docker/docs.git synced 2026-11-05 00:14:17 +03:00

Update comments, and publish in the CLI after remote key rotation

Signed-off-by: Ying Li <ying.li@docker.com>
This commit is contained in:
Ying Li
2016-02-17 11:53:46 -08:00
parent e3716f0be9
commit b6c4840231
3 changed files with 7 additions and 5 deletions

View File

@@ -2554,7 +2554,7 @@ func TestRotateKeyInvalidRole(t *testing.T) {
repo, _ := initializeRepo(t, data.ECDSAKey, "docker.com/notary", ts.URL, false)
defer os.RemoveAll(repo.baseDir)
// the equivalent of: remotely remotely rotating the root key
// the equivalent of: remotely rotating the root key
// (RotateKey("root", true)), locally rotating the root key (RotateKey("root", false)),
// locally rotating the timestamp key (RotateKey("timestamp", false)),
// and remotely rotating the targets key (RotateKey(targets, true)), all of which should

View File

@@ -430,7 +430,11 @@ func (k *keyCommander) keysRotate(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
return nRepo.RotateKey(rotateKeyRole, k.rotateKeyServerManaged)
err = nRepo.RotateKey(rotateKeyRole, k.rotateKeyServerManaged)
if err == nil && k.rotateKeyServerManaged {
err = nRepo.Publish()
}
return err
}
func removeKeyInteractively(keyStores []trustmanager.KeyStore, keyID string,

View File

@@ -366,9 +366,7 @@ func TestRotateKeyRemoteServerManagesKey(t *testing.T) {
cl, err := repo.GetChangelist()
assert.NoError(t, err, "unable to get changelist: %v", err)
assert.Len(t, cl.List(), 1, "expected a single key rotation change")
assert.NoError(t, repo.Publish())
assert.Len(t, cl.List(), 0, "expected the changes to have been published")
finalKeys := repo.CryptoService.ListAllKeys()
assert.Len(t, initialKeys, 3)