Skip to content

Commit

Permalink
Add marker for Trigger condition to mark OIDCIdentity condition as no…
Browse files Browse the repository at this point in the history
…t supported
  • Loading branch information
creydr committed Sep 28, 2023
1 parent 3dfc2ea commit 94941b2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/apis/eventing/v1/trigger_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ limitations under the License.
package v1

import (
"fmt"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"knative.dev/eventing/pkg/apis/feature"
"knative.dev/pkg/apis"
duckv1 "knative.dev/pkg/apis/duck/v1"
)
Expand Down Expand Up @@ -217,3 +220,8 @@ func (ts *TriggerStatus) MarkOIDCIdentityCreatedFailed(reason, messageFormat str
func (ts *TriggerStatus) MarkOIDCIdentityCreatedUnknown(reason, messageFormat string, messageA ...interface{}) {
triggerCondSet.Manage(ts).MarkUnknown(TriggerConditionOIDCIdentityCreated, reason, messageFormat, messageA...)
}

func (ts *TriggerStatus) MarkOIDCIdentityCreatedNotSupported() {
// in case the OIDC feature is not supported, we mark the conditon as true, to not mark the Trigger unready.

Check failure on line 225 in pkg/apis/eventing/v1/trigger_lifecycle.go

View workflow job for this annotation

GitHub Actions / style / Golang / Lint

[github.com/client9/misspell] reported by reviewdog 🐶 "conditon" is a misspelling of "condition" Raw Output: pkg/apis/eventing/v1/trigger_lifecycle.go:225:59: "conditon" is a misspelling of "condition"
triggerCondSet.Manage(ts).MarkTrueWithReason(TriggerConditionOIDCIdentityCreated, fmt.Sprintf("%s feature not yet supported for this Broker class", feature.OIDCAuthentication), "")
}
6 changes: 6 additions & 0 deletions pkg/reconciler/testing/v1/trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,12 @@ func WithTriggerOIDCIdentityCreatedFailed(reason, message string) TriggerOption
}
}

func WithTriggerOIDCIdentityCreatedNotSupported() TriggerOption {
return func(t *v1.Trigger) {
t.Status.MarkOIDCIdentityCreatedNotSupported()
}
}

func WithTriggerOIDCServiceAccountName(name string) TriggerOption {
return func(t *v1.Trigger) {
if t.Status.Auth == nil {
Expand Down

0 comments on commit 94941b2

Please sign in to comment.