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

Sequence and Parallel: announce correct OIDC identities in authstatus #7902

Prev Previous commit
Next Next commit
Update Sequence to expose OIDC identities of underlying Subscriptions
  • Loading branch information
creydr committed May 8, 2024
commit 7ab72b8567c686775504e02810dce9cf94b1a2d3
10 changes: 9 additions & 1 deletion pkg/apis/flows/v1/sequence_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ func (ss *SequenceStatus) InitializeConditions() {
// the status of the incoming subscriptions.
func (ss *SequenceStatus) PropagateSubscriptionStatuses(subscriptions []*messagingv1.Subscription) {
ss.SubscriptionStatuses = make([]SequenceSubscriptionStatus, len(subscriptions))
ss.Auth = nil
allReady := true
// If there are no subscriptions, treat that as a False case. Could go either way, but this seems right.
if len(subscriptions) == 0 {
allReady = false

}

for i, s := range subscriptions {
ss.SubscriptionStatuses[i] = SequenceSubscriptionStatus{
Subscription: corev1.ObjectReference{
Expand All @@ -113,6 +114,13 @@ func (ss *SequenceStatus) PropagateSubscriptionStatuses(subscriptions []*messagi
allReady = false
}

if s.Status.Auth != nil && s.Status.Auth.ServiceAccountName != nil {
if ss.Auth == nil {
ss.Auth = &duckv1.AuthStatus{}
}

ss.Auth.ServiceAccountNames = append(ss.Auth.ServiceAccountNames, *s.Status.Auth.ServiceAccountName)
}
}
if allReady {
sCondSet.Manage(ss).MarkTrue(SequenceConditionSubscriptionsReady)
Expand Down