New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(runJob/kubernetes): use explicit pod name #7039
Conversation
934da6f
to
81e8051
Compare
@maggieneterval curious about how you feel about this approach. LMK! There's a small bit of duplication but I think it's fine given that it's only used in 2 spots. |
81e8051
to
91b0fba
Compare
Hey Ethan, approach seems sane to me! Would love to see a couple tests to help document some of the parsing logic, and maybe just throw your PR description as a comment on the interface sort of explaining why we implemented it? |
2b6b690
to
ea241e8
Compare
@maggieneterval tests added! would you mind giving it another once over for an official review, please :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"official" (:laughing:) review added :heavy_check_mark:
And thanks for adding the tests!!
} | ||
|
||
export class DefaultPodNameProvider implements IPodNameProvider { | ||
public podName: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this can be private?
|
||
export class JobEventBasedPodNameProvider implements IPodNameProvider { | ||
public manifest: IManifest; | ||
public manifestEvent: IManifestEvent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe these can be private as well?
import { IManifestEvent, IManifest } from 'core/domain/IManifest'; | ||
|
||
import { get, trim, bindAll } from 'lodash'; | ||
import { bindAll } from 'lodash'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh sorry I know you didn't create this file but can you please move the lodash import up to the third-part import block with his friends react etc.? 🙏
@@ -5,15 +5,17 @@ import { IStageManifest, ManifestService } from '../ManifestService'; | |||
import { JobManifestPodLogs } from './JobManifestPodLogs'; | |||
import { IManifest } from 'core/domain/IManifest'; | |||
|
|||
import { get, template, isEmpty } from 'lodash'; | |||
import { get, template, isEmpty, trim } from 'lodash'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, lodash misses his BFF react
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣
@@ -8,9 +8,10 @@ import { | |||
} from 'core/pipeline'; | |||
import { IPreconfiguredJobParameter } from './preconfiguredJobStage'; | |||
import { JobStageExecutionLogs } from 'core/manifest/stage/JobStageExecutionLogs'; | |||
import { get } from 'lodash'; | |||
import { get, sortBy, last } from 'lodash'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, react is v. lonely by himself in the first block
@@ -61,9 +62,20 @@ export class TitusExecutionLogs extends React.Component<ITitusExecutionLogsProps | |||
} | |||
} | |||
|
|||
interface IJobOwnedPodStatus { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have this interface twice? Can we just export from one place?
the previous implementation of run job used manifest events to get the name of the pod created by the job. this proved unreliable as events roll off quickly in large environments. this commit implements a `PodNameProvider` interface which supplies `JobManifestPodLogs` with the name of the Pod to fetch logs from. Run Job supplies these Pod names by collecting all Pods owned by the Job. For components which are still event based, the `JobEventBasedPodNameProvider` implements the previously used logic for getting the Pod name from the event.
ea241e8
to
4490842
Compare
@spinnakerbot cherry-pick 1.14 |
Cherry pick successful: #7047 |
the previous implementation of run job used manifest events to get the name of the pod created by the job. this proved unreliable as events roll off quickly in large environments. this commit implements a `PodNameProvider` interface which supplies `JobManifestPodLogs` with the name of the Pod to fetch logs from. Run Job supplies these Pod names by collecting all Pods owned by the Job. For components which are still event based, the `JobEventBasedPodNameProvider` implements the previously used logic for getting the Pod name from the event.
the previous implementation of run job used manifest events to get the name of the pod created by the job. this proved unreliable as events roll off quickly in large environments. this commit implements a `PodNameProvider` interface which supplies `JobManifestPodLogs` with the name of the Pod to fetch logs from. Run Job supplies these Pod names by collecting all Pods owned by the Job. For components which are still event based, the `JobEventBasedPodNameProvider` implements the previously used logic for getting the Pod name from the event.
89e4e78 fix(runJob/kubernetes): reliably display logs (spinnaker#7060) f0287a1 fix(runJob/kubernetes): use explicit pod name (spinnaker#7039) 3fd183e fix(kubernetes): fix runjob stage init (spinnaker#7029) 4f4c32b feat(provider/kubernetes): namespace deployManifest (spinnaker#7016) 8e97d59 refactor(kubernetes): namespace selector component (spinnaker#7012) 53cb422 refactor(kubernetes): convert deploy manifest stage to react (spinnaker#7002) 0194821 feat(runjob): capture output ui (spinnaker#6978)
89e4e78 fix(runJob/kubernetes): reliably display logs (#7060) f0287a1 fix(runJob/kubernetes): use explicit pod name (#7039) 3fd183e fix(kubernetes): fix runjob stage init (#7029) 4f4c32b feat(provider/kubernetes): namespace deployManifest (#7016) 8e97d59 refactor(kubernetes): namespace selector component (#7012) 53cb422 refactor(kubernetes): convert deploy manifest stage to react (#7002) 0194821 feat(runjob): capture output ui (#6978)
the previous implementation of run job used manifest events to get the
name of the pod created by the job. this proved unreliable as events
roll off quickly in large environments. this commit implements a
PodNameProvider
interface which suppliesJobManifestPodLogs
with thename of the Pod to fetch logs from. Run Job supplies these Pod names by
collecting all Pods owned by the Job. For components which are still
event based, the
JobEventBasedPodNameProvider
implements thepreviously used logic for getting the Pod name from the event.