Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/manager/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ func deployChallenge(challenge *database.Challenge, config cfg.BeastChallengeCon
MountsMap: staticMount,
ImageId: challenge.ImageId,
ContainerName: coreUtils.EncodeID(config.Challenge.Metadata.Name),
ChallengeName: config.Challenge.Metadata.Name,
ContainerEnv: containerEnv,
ContainerNetwork: containerNetwork,
Traffic: config.Challenge.Env.TrafficType(),
Expand Down
3 changes: 2 additions & 1 deletion pkg/cr/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type CreateContainerConfig struct {
MountsMap map[string]string
ImageId string
ContainerName string
ChallengeName string
ContainerEnv []string
ContainerNetwork string
Traffic TrafficType
Expand Down Expand Up @@ -141,7 +142,7 @@ func StopAndRemoveContainer(containerId string) error {
}

func CreateContainerFromImage(containerConfig *CreateContainerConfig) (string, error) {
containerName := containerConfig.ContainerName
containerName := fmt.Sprintf("beast_%s_%s", containerConfig.ChallengeName, containerConfig.ContainerName[:3])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can also incorporate the name of competition. Thoughts?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it could be added in the struct and replace beast with comp. name in the container name
But are we taking competition name input anywhere? I didn't see it while running example challs

ctx := context.Background()
cli, err := client.NewEnvClient()
if err != nil {
Expand Down