Skip to content

Commit

Permalink
updated the docker cmd run command; now the name of the container is …
Browse files Browse the repository at this point in the history
…the POD UID
  • Loading branch information
Bianco95 committed Apr 22, 2024
1 parent 9abb59f commit 0a493c3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/docker/Create.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ func (h *SidecarHandler) CreateHandler(w http.ResponseWriter, r *http.Request) {

for _, data := range req {

// get pod UID and save it in a variable
podUID := string(data.Pod.UID)

pathsOfVolumes := make(map[string]string)

for _, volume := range data.Pod.Spec.Volumes {
Expand Down Expand Up @@ -138,9 +141,12 @@ func (h *SidecarHandler) CreateHandler(w http.ResponseWriter, r *http.Request) {
}
}

log.G(h.Ctx).Info("- Creating container " + container.Name)
log.G(h.Ctx).Info("- The name of the container is " + container.Name)
log.G(h.Ctx).Info("- The pod UID is: " + podUID)
log.G(h.Ctx).Info("- The name of the POD will be: " + podUID)


cmd := []string{"run", "-d", "--name", container.Name}
cmd := []string{"run", "-d", "--name", podUID}

cmd = append(cmd, envVars)

Expand Down

0 comments on commit 0a493c3

Please sign in to comment.