-
Notifications
You must be signed in to change notification settings - Fork 597
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
feat: support auto generation of ContainerSource identity service account and expose in AuthStatus #7461
feat: support auto generation of ContainerSource identity service account and expose in AuthStatus #7461
Conversation
Signed-off-by: Griffin <prakritimandal611@gmail.com>
Signed-off-by: Griffin <prakritimandal611@gmail.com>
Hi @prakrit55. 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 Once the patch is verified, the new status will be reflected by the 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. |
Signed-off-by: Griffin <prakritimandal611@gmail.com>
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.
Hey @prakrit55,
thanks a lot for your PR. I left a few comments.
/ok-to-test
serviceaccountInformer := serviceaccountinformer.Get(ctx) | ||
|
||
var globalResync func(obj interface{}) | ||
featureStore := feature.NewStore(logging.FromContext(ctx).Named("featur-config-store"), |
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.
featureStore := feature.NewStore(logging.FromContext(ctx).Named("featur-config-store"), | |
featureStore := feature.NewStore(logging.FromContext(ctx).Named("feature-config-store"), |
@@ -361,3 +435,22 @@ func makeSinkBindingStatus(ready *corev1.ConditionStatus) *sourcesv1.SinkBinding | |||
}, | |||
} | |||
} | |||
|
|||
func makeContainerSourceOIDCServiceAccount() *corev1.ServiceAccount { | |||
return auth.GetOIDCServiceAccountForResource(sourcesv1.SchemeGroupVersion.WithKind("Source"), metav1.ObjectMeta{ |
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.
return auth.GetOIDCServiceAccountForResource(sourcesv1.SchemeGroupVersion.WithKind("Source"), metav1.ObjectMeta{ | |
return auth.GetOIDCServiceAccountForResource(sourcesv1.SchemeGroupVersion.WithKind("ContainerSource"), metav1.ObjectMeta{ |
Signed-off-by: Griffin <prakritimandal611@gmail.com>
@@ -179,6 +195,7 @@ func TestContainerSourceStatusIsReady(t *testing.T) { | |||
s.InitializeConditions() | |||
s.PropagateSinkBindingStatus(¬ReadySinkBinding.Status) | |||
s.PropagateReceiveAdapterStatus(availableDeployment) | |||
s.MarkOIDCIdentityCreatedFailed("unknown", "") |
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.
s.MarkOIDCIdentityCreatedFailed("unknown", "") | |
s.MarkOIDCIdentityCreatedSucceeded() |
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 we should put some cases where it gets failed, to make the tests more obedient.
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.
That would be great if you could add such a test
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.
two more comments regarding the unit test failures.
BTW: you can always run all unit test locally via go test ./...
Signed-off-by: Griffin <prakritimandal611@gmail.com>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7461 +/- ##
==========================================
+ Coverage 76.74% 76.81% +0.06%
==========================================
Files 253 253
Lines 13916 14136 +220
==========================================
+ Hits 10680 10858 +178
- Misses 2702 2736 +34
- Partials 534 542 +8 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Griffin <prakritimandal611@gmail.com>
Signed-off-by: Griffin <prakritimandal611@gmail.com>
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.
Hello @prakrit55,
thanks for adding the tests.
I left a few comments. As mentioned, you can run the tests locally too (via go test ./...
) - this also saves review time 🙃
Signed-off-by: Griffin <prakritimandal611@gmail.com>
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.
Thanks a lot for your contribution @prakrit55!
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: creydr, prakrit55 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 |
/test reconciler-tests |
…vice account and expose in AuthStatus (knative#7461)" This reverts commit 116abe2.
…vice account and expose in AuthStatus (knative#7461)" This reverts commit 116abe2.
…vice account and expose in AuthStatus (knative#7461)" This reverts commit 116abe2.
…vice account and expose in AuthStatus (knative#7461)" This reverts commit 116abe2.
…vice account and expose in AuthStatus (knative#7461)" This reverts commit 116abe2.
…vice account and expose in AuthStatus (knative#7461)" This reverts commit 116abe2.
…vice account and expose in AuthStatus (knative#7461)" This reverts commit 116abe2.
…vice account and expose in AuthStatus (knative#7461)" This reverts commit 116abe2.
…vice account and expose in AuthStatus (knative#7461)" This reverts commit 116abe2.
…nkBinding (#603) * Revert "feat: support auto generation of ContainerSource identity service account and expose in AuthStatus (knative#7461)" This reverts commit 116abe2. * Containersource use OIDC identity of corresponding SinkBinding
…vice account and expose in AuthStatus (knative#7461)" This reverts commit 116abe2.
…nkBinding (#604) * Revert "feat: support auto generation of ContainerSource identity service account and expose in AuthStatus (knative#7461)" This reverts commit 116abe2. * Containersource use OIDC identity of corresponding SinkBinding
Fixes #7228
Proposed Changes
Release Note
Docs