|
|
@@ -75,7 +75,7 @@ or remove sensitive data from your Compose configuration
|
|
|
cmd.Stdin = strings.NewReader("y\n")
|
|
|
res := icmd.RunCmd(cmd)
|
|
|
res.Assert(t, icmd.Expected{ExitCode: 0})
|
|
|
- assert.Assert(t, strings.Contains(res.Combined(), "Are you ok to publish these environment variables? [y/N]:"), res.Combined())
|
|
|
+ assert.Assert(t, strings.Contains(res.Combined(), "Are you ok to publish these environment variables?"), res.Combined())
|
|
|
assert.Assert(t, strings.Contains(res.Combined(), "test/test publishing"), res.Combined())
|
|
|
assert.Assert(t, strings.Contains(res.Combined(), "test/test published"), res.Combined())
|
|
|
})
|
|
|
@@ -86,7 +86,7 @@ or remove sensitive data from your Compose configuration
|
|
|
cmd.Stdin = strings.NewReader("n\n")
|
|
|
res := icmd.RunCmd(cmd)
|
|
|
res.Assert(t, icmd.Expected{ExitCode: 0})
|
|
|
- assert.Assert(t, strings.Contains(res.Combined(), "Are you ok to publish these environment variables? [y/N]:"), res.Combined())
|
|
|
+ assert.Assert(t, strings.Contains(res.Combined(), "Are you ok to publish these environment variables?"), res.Combined())
|
|
|
assert.Assert(t, !strings.Contains(res.Combined(), "test/test publishing"), res.Combined())
|
|
|
assert.Assert(t, !strings.Contains(res.Combined(), "test/test published"), res.Combined())
|
|
|
})
|
|
|
@@ -103,15 +103,16 @@ or remove sensitive data from your Compose configuration
|
|
|
cmd.Stdin = strings.NewReader("n\n")
|
|
|
res := icmd.RunCmd(cmd)
|
|
|
res.Assert(t, icmd.Expected{ExitCode: 0})
|
|
|
- assert.Assert(t, strings.Contains(res.Combined(), `you are about to publish environment variables within your OCI artifact.
|
|
|
-please double check that you are not leaking sensitive data`), res.Combined())
|
|
|
- assert.Assert(t, strings.Contains(res.Combined(), `Service/Config serviceA
|
|
|
-FOO=bar`), res.Combined())
|
|
|
- assert.Assert(t, strings.Contains(res.Combined(), `Service/Config serviceB`), res.Combined())
|
|
|
+ out := res.Combined()
|
|
|
+ assert.Assert(t, strings.Contains(out, `you are about to publish environment variables within your OCI artifact.
|
|
|
+please double check that you are not leaking sensitive data`), out)
|
|
|
+ assert.Assert(t, strings.Contains(out, `Service/Config serviceA
|
|
|
+FOO=bar`), out)
|
|
|
+ assert.Assert(t, strings.Contains(out, `Service/Config serviceB`), out)
|
|
|
// we don't know in which order the env variables will be loaded
|
|
|
- assert.Assert(t, strings.Contains(res.Combined(), `FOO=bar`), res.Combined())
|
|
|
- assert.Assert(t, strings.Contains(res.Combined(), `BAR=baz`), res.Combined())
|
|
|
- assert.Assert(t, strings.Contains(res.Combined(), `QUIX=`), res.Combined())
|
|
|
+ assert.Assert(t, strings.Contains(out, `FOO=bar`), out)
|
|
|
+ assert.Assert(t, strings.Contains(out, `BAR=baz`), out)
|
|
|
+ assert.Assert(t, strings.Contains(out, `QUIX=`), out)
|
|
|
})
|
|
|
|
|
|
t.Run("refuse to publish with bind mount", func(t *testing.T) {
|
|
|
@@ -120,10 +121,11 @@ FOO=bar`), res.Combined())
|
|
|
cmd.Stdin = strings.NewReader("n\n")
|
|
|
res := icmd.RunCmd(cmd)
|
|
|
res.Assert(t, icmd.Expected{ExitCode: 0})
|
|
|
- assert.Assert(t, strings.Contains(res.Combined(), "you are about to publish bind mounts declaration within your OCI artifact."), res.Combined())
|
|
|
- assert.Assert(t, strings.Contains(res.Combined(), "e2e/fixtures/publish:/user-data"), res.Combined())
|
|
|
- assert.Assert(t, strings.Contains(res.Combined(), "Are you ok to publish these bind mount declarations? [y/N]:"), res.Combined())
|
|
|
- assert.Assert(t, !strings.Contains(res.Combined(), "serviceA published"), res.Combined())
|
|
|
+ out := res.Combined()
|
|
|
+ assert.Assert(t, strings.Contains(out, "you are about to publish bind mounts declaration within your OCI artifact."), out)
|
|
|
+ assert.Assert(t, strings.Contains(out, "e2e/fixtures/publish:/user-data"), out)
|
|
|
+ assert.Assert(t, strings.Contains(out, "Are you ok to publish these bind mount declarations?"), out)
|
|
|
+ assert.Assert(t, !strings.Contains(out, "serviceA published"), out)
|
|
|
})
|
|
|
|
|
|
t.Run("publish with bind mount", func(t *testing.T) {
|
|
|
@@ -133,7 +135,7 @@ FOO=bar`), res.Combined())
|
|
|
res := icmd.RunCmd(cmd)
|
|
|
res.Assert(t, icmd.Expected{ExitCode: 0})
|
|
|
assert.Assert(t, strings.Contains(res.Combined(), "you are about to publish bind mounts declaration within your OCI artifact."), res.Combined())
|
|
|
- assert.Assert(t, strings.Contains(res.Combined(), "Are you ok to publish these bind mount declarations? [y/N]:"), res.Combined())
|
|
|
+ assert.Assert(t, strings.Contains(res.Combined(), "Are you ok to publish these bind mount declarations?"), res.Combined())
|
|
|
assert.Assert(t, strings.Contains(res.Combined(), "e2e/fixtures/publish:/user-data"), res.Combined())
|
|
|
assert.Assert(t, strings.Contains(res.Combined(), "test/test published"), res.Combined())
|
|
|
})
|