engine: internal representation of pod (store.pod) contains info on multiple containers [ch3006]#1908
Merged
Merged
Conversation
maiamcc
force-pushed
the
maiamcc/all-containers-on-pod
branch
from
July 24, 2019 20:29
2bf215e to
51958c8
Compare
added 2 commits
July 24, 2019 17:31
maiamcc
marked this pull request as ready for review
July 24, 2019 21:54
nicks
approved these changes
Jul 25, 2019
|
|
||
| func getBlessedContainerID(iTargets []model.ImageTarget, pod *v1.Pod) (container.ID, error) { | ||
| if len(iTargets) > 0 { | ||
| fmt.Println("~~~ GETTING BLESSED CONTAINER ID ~~~") |
| manifest.Name, podInfo.PodID) | ||
| } | ||
|
|
||
| fmt.Printf("Container %s (%s) is blessed? %t\n", cName, cID, cID == blessedCID) |
| cID, err := k8s.ContainerIDFromContainerStatus(cStatus) | ||
| if err != nil { | ||
| logger.Get(ctx).Debugf("Error parsing container ID: %v", err) | ||
| return |
Contributor
There was a problem hiding this comment.
should this be a continue rather than a return?
alternatively, it might be worth moving this to a helper function so that it's harder to make this mistake
| for _, iTarget := range iTargets { | ||
| cStatus, err := k8s.ContainerMatching(pod, container.NameSelector(iTarget.DeploymentRef)) | ||
| if err != nil { | ||
| fmt.Println("~~~ Something went wrong!") |
| iTarget.DeploymentRef.String()) | ||
| } | ||
| if cStatus.Name != "" { | ||
| fmt.Println("~~~ Got it!", cStatus.ContainerID) |
added 3 commits
July 25, 2019 11:32
maiamcc
pushed a commit
that referenced
this pull request
Jul 26, 2019
…r ports' when trying to port fwd (tho port forwarding still worked)
maiamcc
pushed a commit
that referenced
this pull request
Jul 29, 2019
…r ports' when trying to port fwd (tho port forwarding still worked) (#1924)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently when we populate a
*store.Pod, we bless a single container and collect info on that container (see code).First step to enabling us to LiveUpdate multiple containers is to have info for all (relevant) containers on the store.Pod.
This PR only changes structs/data storage -- all logic continues to use info from a single blessed container, to minimize the size of this change.