Skip to content
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

provision sequence audience using channel audience #7387

Conversation

md-saif-husain
Copy link
Contributor

Fixes #7294

Proposed Changes

  • Use channel audience in sequence status.Address.Audience

Release Note

Use underlying input channels audience as sequence audience

@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 Oct 21, 2023
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 21, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 21, 2023
@knative-prow
Copy link

knative-prow bot commented Oct 21, 2023

Welcome @md-saif-husain! It looks like this is your first PR to knative/eventing 🎉

@knative-prow
Copy link

knative-prow bot commented Oct 21, 2023

Hi @md-saif-husain. 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/test-infra repository.

@knative-prow knative-prow bot requested review from aslom and Cali0707 October 21, 2023 07:18
@md-saif-husain md-saif-husain force-pushed the support-channel-audience-as-sequence-audience branch from ba35469 to c2226f2 Compare October 21, 2023 11:28
@md-saif-husain md-saif-husain marked this pull request as ready for review October 22, 2023 13:14
@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 Oct 22, 2023
@knative-prow knative-prow bot requested a review from matzew October 22, 2023 13:14
@creydr
Copy link
Member

creydr commented Oct 23, 2023

/ok-to-test

@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 Oct 23, 2023
@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8ebe869) 76.74% compared to head (f4c087e) 76.79%.
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7387      +/-   ##
==========================================
+ Coverage   76.74%   76.79%   +0.04%     
==========================================
  Files         253      253              
  Lines       13916    14098     +182     
==========================================
+ Hits        10680    10826     +146     
- Misses       2702     2732      +30     
- Partials      534      540       +6     

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

Copy link
Member

@creydr creydr left a comment

Choose a reason for hiding this comment

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

Thanks @md-saif-husain for your PR.
Looks good so far. Only left a small comment. Could you also add an e2e test for it?
You can check on

func TestChannelImplSupportsOIDC(t *testing.T) {
t.Parallel()
ctx, env := global.Environment(
knative.WithKnativeNamespace(system.Namespace()),
knative.WithLoggingConfig,
knative.WithTracingConfig,
k8s.WithEventListener,
environment.Managed(t),
environment.WithPollTimings(4*time.Second, 12*time.Minute),
)
name := feature.MakeRandomK8sName("channelimpl")
env.Prerequisite(ctx, t, channel.ImplGoesReady(name))
env.Test(ctx, t, oidc.AddressableHasAudiencePopulated(channel_impl.GVR(), channel_impl.GVK().Kind, name, env.Namespace()))
}
how this was done for a channel

pkg/apis/flows/v1/sequence_lifecycle_test.go Outdated Show resolved Hide resolved
@md-saif-husain
Copy link
Contributor Author

Thanks @md-saif-husain for your PR. Looks good so far. Only left a small comment. Could you also add an e2e test for it? You can check on

func TestChannelImplSupportsOIDC(t *testing.T) {
t.Parallel()
ctx, env := global.Environment(
knative.WithKnativeNamespace(system.Namespace()),
knative.WithLoggingConfig,
knative.WithTracingConfig,
k8s.WithEventListener,
environment.Managed(t),
environment.WithPollTimings(4*time.Second, 12*time.Minute),
)
name := feature.MakeRandomK8sName("channelimpl")
env.Prerequisite(ctx, t, channel.ImplGoesReady(name))
env.Test(ctx, t, oidc.AddressableHasAudiencePopulated(channel_impl.GVR(), channel_impl.GVK().Kind, name, env.Namespace()))
}

how this was done for a channel

Sure I will add e2e test . Let me know if I can add them in same file as above or it should be new file

@creydr
Copy link
Member

creydr commented Oct 24, 2023

Sure I will add e2e test . Let me know if I can add them in same file as above or it should be new file

Same file should be fine here.

@knative-prow knative-prow bot added the area/test-and-release Test infrastructure, tests or release label Oct 27, 2023
test/auth/oidc_test.go Outdated Show resolved Hide resolved
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 11, 2023
@md-saif-husain md-saif-husain force-pushed the support-channel-audience-as-sequence-audience branch from 10e4c93 to f31db3a Compare November 11, 2023 06:23
@knative-prow-robot knative-prow-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 11, 2023
@md-saif-husain md-saif-husain force-pushed the support-channel-audience-as-sequence-audience branch from f31db3a to 3aab74e Compare November 16, 2023 13:45
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 16, 2023
@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 16, 2023
test/auth/oidc_test.go Outdated Show resolved Hide resolved
pkg/apis/flows/v1/sequence_lifecycle_test.go Show resolved Hide resolved
test/auth/features/oidc/sequence.go Outdated Show resolved Hide resolved
test/auth/features/oidc/sequence.go Outdated Show resolved Hide resolved
test/auth/features/oidc/sequence.go Outdated Show resolved Hide resolved
@md-saif-husain
Copy link
Contributor Author

/retest

Spec: map[string]interface{}{},
})))

env.Test(ctx, t, oidc.SequenceHasAudienceOfInputChannel(sequence.GVR(), sequence.GVK().Kind, name, env.Namespace()))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
env.Test(ctx, t, oidc.SequenceHasAudienceOfInputChannel(sequence.GVR(), sequence.GVK().Kind, name, env.Namespace()))
env.Test(ctx, t, oidc.SequenceHasAudienceOfInputChannel(name, env.Namespace(), channel_impl.GVR(), channel_impl.GVK().Kind))

SequenceHasAudienceOfInputChannel has different parameters:

func SequenceHasAudienceOfInputChannel(sequenceName, sequenceNamespace string, channelGVR schema.GroupVersionResource, channelKind string) *feature.Feature {

Should fix the build issues:

# knative.dev/eventing/test/auth [knative.dev/eventing/test/auth.test]
test/auth/oidc_test.go:118:58: cannot use sequence.GVR() (value of type "k8s.io/apimachinery/pkg/runtime/schema".GroupVersionResource) as string value in argument to oidc.SequenceHasAudienceOfInputChannel
test/auth/oidc_test.go:118:95: cannot use name (variable of type string) as "k8s.io/apimachinery/pkg/runtime/schema".GroupVersionResource value in argument to oidc.SequenceHasAudienceOfInputChannel

Copy link
Member

@creydr creydr left a comment

Choose a reason for hiding this comment

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

Thanks a lot for you contribution @md-saif-husain

/lgtm

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Nov 22, 2023
Copy link

knative-prow bot commented Nov 22, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: creydr, md-saif-husain

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 Nov 22, 2023
@knative-prow knative-prow bot merged commit 64b4847 into knative:main Nov 22, 2023
39 of 41 checks passed
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. area/test-and-release Test infrastructure, tests or release 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support using underlying input channels audience as Sequences audience
4 participants