Merge pull request #1889 from yashsinghcodes/nightly

auto find the orborus container
This commit is contained in:
Yash Singh
2025-11-24 18:01:20 +05:30
committed by GitHub
2 changed files with 26 additions and 1 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ require (
github.com/docker/docker v28.3.3+incompatible
github.com/docker/go-connections v0.5.0
github.com/satori/go.uuid v1.2.0
github.com/shuffle/shuffle-shared v0.9.58
github.com/shuffle/shuffle-shared v0.9.59
k8s.io/api v0.33.1
k8s.io/apimachinery v0.33.1
)
+25
View File
@@ -142,6 +142,28 @@ func init() {
log.Printf("Unable to create docker client: %s", err)
}
if os.Getenv("SHUFFLE_EC2_INSTANCE") == "true" {
log.Printf("[INFO] Detected AWS EC2 instance. Setting up Docker Swarm with AWS optimizations.")
containers, err := dockercli.ContainerList(context.Background(), container.ListOptions{})
if err == nil {
for _, container := range containers {
if strings.Contains(container.Image, "shuffle-orborus") {
if len(container.Names) != 0 {
if strings.Contains(container.Names[0], "shuffle-orborus") {
containerName = container.Names[0]
containerName = strings.TrimPrefix(containerName, "/")
os.Setenv("ORBORUS_CONTAINER_NAME", containerName)
log.Printf("[DEBUG] Found orborus container name: %s", containerName)
break
}
}
}
}
} else {
log.Printf("[ERROR] Failed to find orborus container: %s", err)
}
}
getThisContainerId()
if len(pipelineApikey) == 0 {
@@ -2416,6 +2438,7 @@ func main() {
}
if swarmConfig == "run" || swarmConfig == "swarm" || isKubernetes == "true" {
if isKubernetes != "true" {
checkSwarmService(ctx)
}
@@ -2750,6 +2773,8 @@ func main() {
fmt.Sprintf("/detections/Sigma"),
org,
true,
"LOW",
"TENZIR_START",
)
if err != nil {