Rename to flags and environment variables to content trust
Update help line to allow 90 characters instead of 80 The trust flag pushes out the help description column wider, requiring more room to display help messages. Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan) Upstream-commit: 259cadb0b19a9049302e78fec529b0105efabb1d Component: engine
This commit is contained in:
@@ -294,7 +294,7 @@ func (s *DockerTrustSuite) TestTrustedCreate(c *check.C) {
|
||||
dockerCmd(c, "rmi", repoName)
|
||||
|
||||
// Try untrusted create to ensure we pushed the tag to the registry
|
||||
createCmd = exec.Command(dockerBinary, "create", "--untrusted=true", repoName)
|
||||
createCmd = exec.Command(dockerBinary, "create", "--disable-content-trust=true", repoName)
|
||||
s.trustedCmd(createCmd)
|
||||
out, _, err = runCommandWithOutput(createCmd)
|
||||
if err != nil {
|
||||
@@ -302,7 +302,7 @@ func (s *DockerTrustSuite) TestTrustedCreate(c *check.C) {
|
||||
}
|
||||
|
||||
if !strings.Contains(string(out), "Status: Downloaded") {
|
||||
c.Fatalf("Missing expected output on trusted create with --untrusted:\n%s", out)
|
||||
c.Fatalf("Missing expected output on trusted create with --disable-content-trust:\n%s", out)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ func (s *DockerTrustSuite) TestCreateWhenCertExpired(c *check.C) {
|
||||
|
||||
runAtDifferentDate(elevenYearsFromNow, func() {
|
||||
// Try create
|
||||
createCmd := exec.Command(dockerBinary, "create", "--untrusted", repoName)
|
||||
createCmd := exec.Command(dockerBinary, "create", "--disable-content-trust", repoName)
|
||||
s.trustedCmd(createCmd)
|
||||
out, _, err := runCommandWithOutput(createCmd)
|
||||
if err != nil {
|
||||
|
||||
@@ -132,7 +132,7 @@ func (s *DockerSuite) TestHelpTextVerify(c *check.C) {
|
||||
// Check each line for lots of stuff
|
||||
lines := strings.Split(out, "\n")
|
||||
for _, line := range lines {
|
||||
if len(line) > 80 {
|
||||
if len(line) > 90 {
|
||||
c.Fatalf("Help for %q is too long(%d chars):\n%s", cmd,
|
||||
len(line), line)
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ func (s *DockerTrustSuite) TestTrustedPull(c *check.C) {
|
||||
dockerCmd(c, "rmi", repoName)
|
||||
|
||||
// Try untrusted pull to ensure we pushed the tag to the registry
|
||||
pullCmd = exec.Command(dockerBinary, "pull", "--untrusted=true", repoName)
|
||||
pullCmd = exec.Command(dockerBinary, "pull", "--disable-content-trust=true", repoName)
|
||||
s.trustedCmd(pullCmd)
|
||||
out, _, err = runCommandWithOutput(pullCmd)
|
||||
if err != nil {
|
||||
@@ -182,7 +182,7 @@ func (s *DockerTrustSuite) TestTrustedPull(c *check.C) {
|
||||
}
|
||||
|
||||
if !strings.Contains(string(out), "Status: Downloaded") {
|
||||
c.Fatalf("Missing expected output on trusted pull with --untrusted:\n%s", out)
|
||||
c.Fatalf("Missing expected output on trusted pull with --disable-content-trust:\n%s", out)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ func (s *DockerTrustSuite) TestPullWhenCertExpired(c *check.C) {
|
||||
|
||||
runAtDifferentDate(elevenYearsFromNow, func() {
|
||||
// Try pull
|
||||
pullCmd := exec.Command(dockerBinary, "pull", "--untrusted", repoName)
|
||||
pullCmd := exec.Command(dockerBinary, "pull", "--disable-content-trust", repoName)
|
||||
s.trustedCmd(pullCmd)
|
||||
out, _, err := runCommandWithOutput(pullCmd)
|
||||
if err != nil {
|
||||
|
||||
@@ -182,15 +182,15 @@ func (s *DockerTrustSuite) TestTrustedPushWithoutServerAndUntrusted(c *check.C)
|
||||
// tag the image and upload it to the private registry
|
||||
dockerCmd(c, "tag", "busybox", repoName)
|
||||
|
||||
pushCmd := exec.Command(dockerBinary, "push", "--untrusted", repoName)
|
||||
pushCmd := exec.Command(dockerBinary, "push", "--disable-content-trust", repoName)
|
||||
s.trustedCmdWithServer(pushCmd, "example/")
|
||||
out, _, err := runCommandWithOutput(pushCmd)
|
||||
if err != nil {
|
||||
c.Fatalf("trusted push with no server and --untrusted failed: %s\n%s", err, out)
|
||||
c.Fatalf("trusted push with no server and --disable-content-trust failed: %s\n%s", err, out)
|
||||
}
|
||||
|
||||
if strings.Contains(string(out), "Error establishing connection to notary repository") {
|
||||
c.Fatalf("Missing expected output on trusted push with --untrusted:\n%s", out)
|
||||
c.Fatalf("Missing expected output on trusted push with --disable-content-trust:\n%s", out)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ func (s *DockerTrustSuite) TestTrustedPushWithExistingSignedTag(c *check.C) {
|
||||
}
|
||||
|
||||
if !strings.Contains(string(out), "Status: Downloaded") {
|
||||
c.Fatalf("Missing expected output on trusted pull with --untrusted:\n%s", out)
|
||||
c.Fatalf("Missing expected output on trusted pull with --disable-content-trust:\n%s", out)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2566,7 +2566,7 @@ func (s *DockerTrustSuite) TestTrustedRun(c *check.C) {
|
||||
dockerCmd(c, "rmi", repoName)
|
||||
|
||||
// Try untrusted run to ensure we pushed the tag to the registry
|
||||
runCmd = exec.Command(dockerBinary, "run", "--untrusted=true", repoName)
|
||||
runCmd = exec.Command(dockerBinary, "run", "--disable-content-trust=true", repoName)
|
||||
s.trustedCmd(runCmd)
|
||||
out, _, err = runCommandWithOutput(runCmd)
|
||||
if err != nil {
|
||||
@@ -2574,7 +2574,7 @@ func (s *DockerTrustSuite) TestTrustedRun(c *check.C) {
|
||||
}
|
||||
|
||||
if !strings.Contains(string(out), "Status: Downloaded") {
|
||||
c.Fatalf("Missing expected output on trusted run with --untrusted:\n%s", out)
|
||||
c.Fatalf("Missing expected output on trusted run with --disable-content-trust:\n%s", out)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2620,7 +2620,7 @@ func (s *DockerTrustSuite) TestRunWhenCertExpired(c *check.C) {
|
||||
|
||||
runAtDifferentDate(elevenYearsFromNow, func() {
|
||||
// Try run
|
||||
runCmd := exec.Command(dockerBinary, "run", "--untrusted", repoName)
|
||||
runCmd := exec.Command(dockerBinary, "run", "--disable-content-trust", repoName)
|
||||
s.trustedCmd(runCmd)
|
||||
out, _, err := runCommandWithOutput(runCmd)
|
||||
if err != nil {
|
||||
|
||||
@@ -130,11 +130,11 @@ func (s *DockerTrustSuite) trustedCmdWithPassphrases(cmd *exec.Cmd, rootPwd, sna
|
||||
|
||||
func trustCmdEnv(cmd *exec.Cmd, server, rootPwd, snapshotPwd, targetPwd string) {
|
||||
env := []string{
|
||||
"DOCKER_TRUST=1",
|
||||
fmt.Sprintf("DOCKER_TRUST_SERVER=%s", server),
|
||||
fmt.Sprintf("DOCKER_TRUST_ROOT_PASSPHRASE=%s", rootPwd),
|
||||
fmt.Sprintf("DOCKER_TRUST_SNAPSHOT_PASSPHRASE=%s", snapshotPwd),
|
||||
fmt.Sprintf("DOCKER_TRUST_TARGET_PASSPHRASE=%s", targetPwd),
|
||||
"DOCKER_CONTENT_TRUST=1",
|
||||
fmt.Sprintf("DOCKER_CONTENT_TRUST_SERVER=%s", server),
|
||||
fmt.Sprintf("DOCKER_CONTENT_TRUST_ROOT_PASSPHRASE=%s", rootPwd),
|
||||
fmt.Sprintf("DOCKER_CONTENT_TRUST_SNAPSHOT_PASSPHRASE=%s", snapshotPwd),
|
||||
fmt.Sprintf("DOCKER_CONTENT_TRUST_TARGET_PASSPHRASE=%s", targetPwd),
|
||||
}
|
||||
cmd.Env = append(os.Environ(), env...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user