test(palemoon): rewrite to use ci-images

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso
2025-07-24 15:52:16 -04:00
parent 7d60a0a77a
commit 50cfe72cef
24 changed files with 573 additions and 79 deletions

View File

@@ -0,0 +1,34 @@
package internal
import (
"context"
"log"
"os"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/client"
)
// UnbreakDocker connects the container named after the current hostname
// to the specified Docker network.
func UnbreakDocker(networkName string) error {
ctx := context.Background()
cli, err := client.NewClientWithOpts(client.FromEnv)
if err != nil {
return err
}
hostname, err := os.Hostname()
if err != nil {
return err
}
err = cli.NetworkConnect(ctx, networkName, hostname, &network.EndpointSettings{})
if err != nil {
return err
}
log.Printf("Connected container %q to network %q\n", hostname, networkName)
return nil
}