Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Isolation strings, should match user input
When we parse isolation we expect users to input chroot, oci, rootless. So when we translate the constants back to strings, we should use the same values. These human names need to be passed over the podman-remote build bindings, so we need to make them match. Also docker describes an isolation of "default", which we should also handle for potential scripts. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
- Loading branch information
Showing
3 changed files
with
29 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package define | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/containers/buildah/pkg/parse" | ||
) | ||
|
||
func TestIsolation(t *testing.T) { | ||
isolations = []string{"", "default", "oci", "chroot", "rootless"} | ||
for _, i := range isolations { | ||
isolation, err := parse.Isolation(i) | ||
if err != nil { | ||
t.Error("Isolation %s not supported.", i) | ||
} | ||
expected := i | ||
if i == "" || i == "default" { | ||
expected = "oci" | ||
} | ||
if isolation.String() != expected { | ||
t.Error("Isolation %s not equal to user input %s.", isolation.String(), i) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters