8000 feat: support for additional pod scheduling definition on IntegrationSource by S-Mann · Pull Request #8601 · knative/eventing · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: support for additional pod scheduling definition on IntegrationSource #8601

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

Merged
merged 10 commits into from
Jun 23, 2025

Conversation

S-Mann
Copy link
Contributor
@S-Mann S-Mann commented Jun 17, 2025

Proposed Changes

Pre-review Checklist

  • At least 80% unit test coverage
  • E2E tests for any new behavior
  • Docs PR for any user-facing impact
  • Spec PR for any new API feature
  • Conformance test for any change to the spec

Release Note


Docs

@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 17, 2025
Copy link
linux-foundation-easycla bot commented Jun 17, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link
knative-prow bot commented Jun 17, 2025

Welcome @S-Mann! It looks like this is your first PR to knative/eventing 🎉

@knative-prow knative-prow bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 17, 2025
Copy link
knative-prow bot commented Jun 17, 2025

Hi @S-Mann. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@knative-prow knative-prow bot requested review from aliok and matzew June 17, 2025 18:23
@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 18, 2025
@S-Mann S-Mann marked this pull request as ready for review June 19, 2025 20:59
@knative-prow knative-prow bot requested a review from Leo6Leo June 19, 2025 20:59
@S-Mann
Copy link
Contributor Author
S-Mann commented Jun 19, 2025

/cc @Cali0707

@knative-prow knative-prow bot requested a review from Cali0707 June 19, 2025 20:59
@Cali0707
Copy link
Member

/ok-to-test

8000
@knative-prow knative-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 19, 2025
Copy link
codecov bot commented Jun 19, 2025

Codecov Report

Attention: Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.

Project coverage is 52.29%. Comparing base (a582a88) to head (6a883fd).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...er/integration/source/resources/containersource.go 84.21% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8601      +/-   ##
==========================================
- Coverage   52.32%   52.29%   -0.03%     
==========================================
  Files         398      398              
  Lines       25036    25040       +4     
==========================================
- Hits        13099    13094       -5     
- Misses      11139    11145       +6     
- Partials      798      801       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Cali0707 Cali0707 changed the title [WIP] feat: support for pod spec initially only for scheduling feat: support for pod spec initially only for scheduling Jun 20, 2025
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 20, 2025
Copy link
Member
@Cali0707 Cali0707 left a comment

Choose a reason for hiding this comment

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

Awesome start @S-Mann !

I left one comment regarding setting labels, so that we can allow users to add more labels to the pods. Otherwise, lgtm

Comment on lines 35 to 41
source.Spec.Template.ObjectMeta = metav1.ObjectMeta{
Labels: integration.Labels(source.Name),
}
Copy link
Member

Choose a reason for hiding this comment

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

Here instead of setting the full ObjectMeta, could we maybe just append the integration.Labels(source.Name) to any existing labels set in the template?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh my god you are right!! I missed this, overriding the whole metadata is a bad idea I think
thank you so much!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if you are happy with my latest code you can mark this resolved

@Cali0707 Cali0707 linked an issue Jun 20, 2025 that may be closed by this pull request
@S-Mann S-Mann changed the title feat: support for pod spec initially only for scheduling feat: support for additional pod scheduling definition on IntegrationSource Jun 20, 2025
if source.Spec.Template == nil {
source.Spec.Template = &corev1.PodTemplateSpec{}
}
source.Spec.Template.ObjectMeta.Labels = integration.Labels(source.Name)
Copy link
Member

Choose a reason for hiding this comment

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

This will still overwrite any other existing labels defined by the user. I think we need something along the lines of:

Suggested change
source.Spec.Template.ObjectMeta.Labels = integration.Labels(source.Name)
if source.Spec.Template.ObjectMeta.Labels == nil {
source.Spec.Template.ObjectMeta.Labels = integration.Labels(source.Name)
} else {
source.Spec.Template.ObjectMeta.Labels = append(source.Spec.Template.ObjectMeta.Labels, integration.Labels(source.Name)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the code, so that labels that we are defining will be overwritten and other labels the users define will stay untouched

@S-Mann S-Mann requested a review from Cali0707 June 23, 2025 16:44
S-Mann added 3 commits June 23, 2025 18:15
Signed-off-by: S-Mann <29407727+S-Mann@users.noreply.github.com>
Signed-off-by: S-Mann <29407727+S-Mann@users.noreply.github.com>
Signed-off-by: S-Mann <29407727+S-Mann@users.noreply.github.com>
S-Mann added 6 commits June 23, 2025 18:16
Signed-off-by: S-Mann <29407727+S-Mann@users.noreply.github.com>
…ersource CRDs

Signed-off-by: S-Mann <29407727+S-Mann@users.noreply.github.com>
Signed-off-by: S-Mann <29407727+S-Mann@users.noreply.github.com>
Signed-off-by: S-Mann <29407727+S-Mann@users.noreply.github.com>
Signed-off-by: S-Mann <29407727+S-Mann@users.noreply.github.com>
Signed-off-by: S-Mann <29407727+S-Mann@users.noreply.github.com>
Signed-off-by: S-Mann <29407727+S-Mann@users.noreply.github.com>
Copy link
Member
@Cali0707 Cali0707 left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Thanks @S-Mann !

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jun 23, 2025
Copy link
knative-prow bot commented Jun 23, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cali0707, S-Mann

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 23, 2025
@knative-prow knative-prow bot merged commit 5de389b into knative:main Jun 23, 2025
36 checks passed
@S-Mann S-Mann deleted the issues/8597 branch June 24, 2025 10:20
source.Spec.Template.Spec.Containers = []corev1.Container{
{
Name: "source",
Image: selectImage(source),
Copy link
Member

Choose a reason for hiding this comment

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

can we add a test to make sure the image can not be overriden?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure @matzew
can you please create an issue for this? I will add the test case

Copy link
Member

Choose a reason for hiding this comment

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

@S-Mann here we go: #8609

@matzew
Copy link
Member
matzew commented Jun 24, 2025

@S-Mann the scaling would also make sense on the IntegrationSink ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for additional pod scheduling definition on IntegrationSource
3 participants
0