Add probe for Kubernetes jobs#76
Conversation
bzurkowski
left a comment
There was a problem hiding this comment.
It's almost perfect. Minor remarks. Thanks!
|
|
||
| @classmethod | ||
| def get(cls, graph): | ||
| return super().get(graph, 'job', extractor.JobExtractor()) No newline at end of file |
| properties['name'] = reference.name | ||
| properties['uid'] = reference.uid | ||
| references.append(properties) | ||
| return references No newline at end of file |
|
|
||
| class JobToPodMatcher(Matcher): | ||
|
|
||
| """Generic matcher for links between Job and Pod entities.""" |
There was a problem hiding this comment.
Well, it's not "generic". It's just a matcher 😉
|
|
||
|
|
| properties['namespace'] = entity.metadata.namespace | ||
| properties['labels'] = entity.metadata.labels.copy() | ||
| properties['selector'] = entity.spec.selector.match_labels | ||
| properties['owner_references'] = self._extract_references(entity) |
There was a problem hiding this comment.
What we need here is a reference to a cron job - there is always only one for a given job. Maybe we could switch to a simpler field named cron_job_ref that would contain the first cron job item found in the owner_references payload?. Something similar to target_ref in HorizontalPodAutoscalerExtractor?
| probe=probe.JobPullProbe, | ||
| linkers=[ | ||
| linker.JobToPodLinker, | ||
| linker.CronJobToJobLinker |
There was a problem hiding this comment.
The CronJobToJobLinker does not exist at this point - it was added in a separate PR. Therefore, we should remove the reference to the non-existent linker from probe bundles added in this PR, otherwise, it throws errors.
- Remove cron job linker reference.
- Merge this PR into master branch.
- Rebase cron job probe PR (Add probe for Kubernetes cron_jobs #77) with master branch to include changes related to job probe.
- Add missing linker references in probe bundles.
| probe=probe.JobPushProbe, | ||
| linkers=[ | ||
| linker.JobToPodLinker, | ||
| linker.CronJobToJobLinker |
There was a problem hiding this comment.
The CronJobToJobLinker does not exist at this point. It's in a separate PR.
d337ad2 to
d050a55
Compare
Signed-off-by: Aleksandra Galara <a.galara@samsung.com>
d050a55 to
f3532cd
Compare
It implements #26
Signed-off-by: Aleksandra Galara a.galara@samsung.com