mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
tests: create remote with container helper
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@ -244,10 +244,10 @@ func (f *factory) AllowsInstances() bool {
|
||||
// eg. "buildx_buildkit_loving_mendeleev0" -> "loving-mendeleev0"
|
||||
func buildxNameToDeploymentName(bx string) (string, error) {
|
||||
// TODO: commands.util.go should not pass "buildx_buildkit_" prefix to drivers
|
||||
if !strings.HasPrefix(bx, "buildx_buildkit_") {
|
||||
return "", errors.Errorf("expected a string with \"buildx_buildkit_\", got %q", bx)
|
||||
s, err := driver.ParseBuilderName(bx)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
s := strings.TrimPrefix(bx, "buildx_buildkit_")
|
||||
s = strings.ReplaceAll(s, "_", "-")
|
||||
return s, nil
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
}
|
||||
|
||||
cfg := driver.InitConfig{
|
||||
Name: "buildx_buildkit_test",
|
||||
Name: driver.BuilderName("test"),
|
||||
KubeClientConfig: &kcc,
|
||||
}
|
||||
f := factory{}
|
||||
|
Reference in New Issue
Block a user