upgrade to latest dependencies (#1519)

bumping knative.dev/eventing 31e4e2e...1241853:
  > 1241853 Update support rotation (# 5883)
  > d5201e7 Add test for default deadLetterSink namespace in generic Channel (# 5908)
  > 24b20f3 upgrade to latest dependencies (# 5902)
  > 8dd3598 Retry on any webhook EOF error (# 5895)
  > 1e9f9f1 Implement CE Subscriptions filters (# 5715)
  > 62219cc upgrade to latest dependencies (# 5894)
  > 536f2b9 Fix subscription re-resolving channel dlsuri when using it's channel DLS (# 5872)
  > 3787a04 Update actions (# 5890)
  > 91c1208 upgrade miekg nad jwt-go to resolve vulnerabilities (# 5889)
bumping knative.dev/pkg 91d1932...517ef02:
  > 517ef02 upgrade to latest dependencies (# 2349)
  > 0b0c339 Remove unclear comment for makeSpoofClient() (# 2347)
  > cd0d505 Update actions (# 2346)
bumping knative.dev/serving c02ef31...dae92fc:
  > dae92fc Fix TestRouteCreation to be consistent (# 12283)
  > 532231b HPA v2beta2 (# 12278)
  > 670bab7 Update net-contour nightly (# 12275)
  > 86a64c3 Update net-kourier nightly (# 12276)
  > dbe20a7 Update net-istio nightly (# 12274)
  > fad7b08 upgrade to latest dependencies (# 12273)
  > eb83774 Update net-contour nightly (# 12268)
  > 883e1cb Update net-kourier nightly (# 12269)
  > 9aa902f Update net-certmanager nightly (# 12267)
  > 24766a5 remove mako tests and dependency (# 12266)
  > 8f4ab1f Disable activator probe optimisation when exec probe is specified (# 12250)
  > 4861d5f Support image resolution for init containers (# 12152)
  > b84916c Drop unneeded if blocks from validation (# 12261)
  > bf9dfbd Drop goroutine leak test for statsserver (# 12259)
  > 1f77419 Update net-contour nightly (# 12263)
  > 8e1233e upgrade to latest dependencies (# 12265)
  > 7a316be Update net-kourier nightly (# 12262)
  > a54c867 Update net-istio nightly (# 12252)
  > 0410338 Update actions (# 12258)
  > 6c3394b upgrade to latest dependencies (# 12256)
  > 67f3678 Update net-certmanager nightly (# 12254)
  > cec45d3 Update net-kourier nightly (# 12253)
  > 47fd41b Update net-contour nightly (# 12251)
  > bfa5f8a upgrade to latest dependencies (# 12248)
  > 92b5a12 Update k8s app labels (# 12247)
bumping knative.dev/networking 1507a59...3f45c8b:
  > 3f45c8b bump downstream workflow to use go1.17 (# 563)
  > 9d00526 upgrade to latest dependencies (# 561)
  > 526348e upgrade to latest dependencies (# 560)
  > 4755ad1 Update actions (# 559)
bumping knative.dev/hack 96aac1c...128cf01:
  > 128cf01 Allows to see tag from build_release func (# 104)
  > e1db8b2 chore: further explain knative CRD-generation support (# 105)

Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
knative-automation 2021-11-16 10:24:52 -08:00 committed by GitHub
parent 86cbd7c794
commit d0adde433d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 350 additions and 70 deletions

10
go.mod
View File

@ -18,10 +18,10 @@ require (
k8s.io/cli-runtime v0.21.4 k8s.io/cli-runtime v0.21.4
k8s.io/client-go v0.21.4 k8s.io/client-go v0.21.4
k8s.io/code-generator v0.21.4 k8s.io/code-generator v0.21.4
knative.dev/eventing v0.27.1-0.20211109172546-31e4e2eb26d1 knative.dev/eventing v0.27.1-0.20211116113552-12418535e186
knative.dev/hack v0.0.0-20211108170701-96aac1c30be3 knative.dev/hack v0.0.0-20211112192837-128cf0150a69
knative.dev/networking v0.0.0-20211109174044-1507a59cf35c knative.dev/networking v0.0.0-20211116075352-3f45c8b29bc1
knative.dev/pkg v0.0.0-20211109100843-91d1932616a7 knative.dev/pkg v0.0.0-20211115071955-517ef0292b53
knative.dev/serving v0.27.1-0.20211109195444-c02ef3147516 knative.dev/serving v0.27.1-0.20211116120552-dae92fcaf11a
sigs.k8s.io/yaml v1.3.0 sigs.k8s.io/yaml v1.3.0
) )

28
go.sum
View File

@ -1710,24 +1710,26 @@ k8s.io/legacy-cloud-providers v0.21.0/go.mod h1:bNxo7gDg+PGkBmT/MFZswLTWdSWK9kAl
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 h1:0T5IaWHO3sJTEmCP6mUlBvMukxPKUQWqiI/YuiBNMiQ= k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 h1:0T5IaWHO3sJTEmCP6mUlBvMukxPKUQWqiI/YuiBNMiQ=
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
knative.dev/caching v0.0.0-20211109020143-eceaa05e3ecc/go.mod h1:B1UvFZohVEmH+Fruuimvj5uJZcGde8F5ZhtYapFnyVg= knative.dev/caching v0.0.0-20211111075937-0c3d96f98a71/go.mod h1:B1UvFZohVEmH+Fruuimvj5uJZcGde8F5ZhtYapFnyVg=
knative.dev/eventing v0.27.1-0.20211109172546-31e4e2eb26d1 h1:vC/EpcYF1lsvaapxNGmz6vGNZfq94/1Fd770SQTZ9Es= knative.dev/eventing v0.27.1-0.20211116113552-12418535e186 h1:Bcz4Wul/NOx+o1XdAhZecupkaUcHg781FBCrlfTjDbU=
knative.dev/eventing v0.27.1-0.20211109172546-31e4e2eb26d1/go.mod h1:zHDfFKGqgq9bZvUd3QC6iHRAaj2AbHercYhlxdtc9fA= knative.dev/eventing v0.27.1-0.20211116113552-12418535e186/go.mod h1:eJGGW9Rbrq585P2Ppc0a+nDLfJzGXe/R8eMXcNwUKlI=
knative.dev/hack v0.0.0-20211101195839-11d193bf617b/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= knative.dev/hack v0.0.0-20211101195839-11d193bf617b/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack v0.0.0-20211105231158-29f86c2653b5/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= knative.dev/hack v0.0.0-20211105231158-29f86c2653b5/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack v0.0.0-20211108170701-96aac1c30be3 h1:oSvRgnKoU308k7aXbPV3iL5Zh5kBGM2Ptar4hyeda+A=
knative.dev/hack v0.0.0-20211108170701-96aac1c30be3/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= knative.dev/hack v0.0.0-20211108170701-96aac1c30be3/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack/schema v0.0.0-20211108170701-96aac1c30be3/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0= knative.dev/hack v0.0.0-20211112192837-128cf0150a69 h1:/3NW6B9VeqAwpW0ZAS+8xLfwgVMIqH+CPmesDATovhk=
knative.dev/networking v0.0.0-20211109063843-5ee89331e361/go.mod h1:k+A0D662HneO3gjsvzjSbPkJt+ihUSHm4Cxw49Y5j/w= knative.dev/hack v0.0.0-20211112192837-128cf0150a69/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/networking v0.0.0-20211109174044-1507a59cf35c h1:awrpNjtd0HmquFzQkZwe+9ppVy7mka27vvKSJo6YmN0= knative.dev/hack/schema v0.0.0-20211112192837-128cf0150a69/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0=
knative.dev/networking v0.0.0-20211109174044-1507a59cf35c/go.mod h1:k+A0D662HneO3gjsvzjSbPkJt+ihUSHm4Cxw49Y5j/w= knative.dev/networking v0.0.0-20211111131538-526348e63718/go.mod h1:XskFTw7FTMeGwD60lrTT+P3BNp59fJxLS0019WNHq9o=
knative.dev/networking v0.0.0-20211116075352-3f45c8b29bc1 h1:CSjr5XM8oMlftjSENHSB+sxdr1k36CWlJwq6ou8TQM8=
knative.dev/networking v0.0.0-20211116075352-3f45c8b29bc1/go.mod h1:+MZjHIMRatw4Nf2U9xDJBStXUDcdjAcbrZL7iGU6tjY=
knative.dev/pkg v0.0.0-20211101212339-96c0204a70dc/go.mod h1:SkfDk9bWIiNZD7XtILGkG7AKVyF/M6M0bGxLgl0SYL8= knative.dev/pkg v0.0.0-20211101212339-96c0204a70dc/go.mod h1:SkfDk9bWIiNZD7XtILGkG7AKVyF/M6M0bGxLgl0SYL8=
knative.dev/pkg v0.0.0-20211108064904-3cc697a3cb09/go.mod h1:YiSfFDMdYHZTuO5XS8UzxSeOEmocy+Kb2YOGik9C8lw= knative.dev/pkg v0.0.0-20211108064904-3cc697a3cb09/go.mod h1:YiSfFDMdYHZTuO5XS8UzxSeOEmocy+Kb2YOGik9C8lw=
knative.dev/pkg v0.0.0-20211109100843-91d1932616a7 h1:uqo0nLez3NJf03gE9mdYpFxbqZ8iWdVElQa+s8W7VNQ= knative.dev/pkg v0.0.0-20211111114938-0b0c3390a475/go.mod h1:plYIuKk6WNC9LyiG/9xBnOBYuxO0Ro6xN0z7iXWVUtk=
knative.dev/pkg v0.0.0-20211109100843-91d1932616a7/go.mod h1:plYIuKk6WNC9LyiG/9xBnOBYuxO0Ro6xN0z7iXWVUtk= knative.dev/pkg v0.0.0-20211115071955-517ef0292b53 h1:rzKI45d30Gi6Wyg2FgPOSqVB1wYwHOjG4cB6sAFkyVk=
knative.dev/reconciler-test v0.0.0-20211101213739-c5f938aa9974/go.mod h1:gTsbLk496j/M9xqMpx/liyCQ0X3bwDpRtcs2Zzws364= knative.dev/pkg v0.0.0-20211115071955-517ef0292b53/go.mod h1:VqUp1KWJqpTDNoiSI/heaX3uMdubImslJE2tBkP+Bbw=
knative.dev/serving v0.27.1-0.20211109195444-c02ef3147516 h1:cny97YW42CGXYxfNvO1KS6G6iuC4QmkwFmGNAZFf9fg= knative.dev/reconciler-test v0.0.0-20211112132636-ae9e2e21972f/go.mod h1:gTsbLk496j/M9xqMpx/liyCQ0X3bwDpRtcs2Zzws364=
knative.dev/serving v0.27.1-0.20211109195444-c02ef3147516/go.mod h1:NvsLBPP8/Hz01rplIWfETwXjtJYRrJjYlJezBhTYIdc= knative.dev/serving v0.27.1-0.20211116120552-dae92fcaf11a h1:4HvaidDS83x+iu7bag7+JAAJ/rS6J4+5Nj5mWLYqVA8=
knative.dev/serving v0.27.1-0.20211116120552-dae92fcaf11a/go.mod h1:sldNhpKRW7/XlYR6hMwdUQfWCWOYNxHmgi5u1lBG3jM=
pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=

View File

@ -83,8 +83,22 @@ type TriggerSpec struct {
// +optional // +optional
Filter *TriggerFilter `json:"filter,omitempty"` Filter *TriggerFilter `json:"filter,omitempty"`
// Subscriber is the addressable that receives events from the Broker that pass the Filter. It // Filters is an experimental field that conforms to the CNCF CloudEvents Subscriptions
// is required. // API. It's an array of filter expressions that evaluate to true or false.
// If any filter expression in the array evaluates to false, the event MUST
// NOT be sent to the Subscriber. If all the filter expressions in the array
// evaluate to true, the event MUST be attempted to be delivered. Absence of
// a filter or empty array implies a value of true. In the event of users
// specifying both Filter and Filters, then the latter will override the former.
// This will allow users to try out the effect of the new Filters field
// without compromising the existing attribute-based Filter and try it out on existing
// Trigger objects.
//
// +optional
Filters []SubscriptionsAPIFilter `json:"filters,omitempty"`
// Subscriber is the addressable that receives events from the Broker that pass
// the Filter. It is required.
Subscriber duckv1.Destination `json:"subscriber"` Subscriber duckv1.Destination `json:"subscriber"`
// Delivery contains the delivery spec for this specific trigger. // Delivery contains the delivery spec for this specific trigger.
@ -96,17 +110,77 @@ type TriggerFilter struct {
// Attributes filters events by exact match on event context attributes. // Attributes filters events by exact match on event context attributes.
// Each key in the map is compared with the equivalent key in the event // Each key in the map is compared with the equivalent key in the event
// context. An event passes the filter if all values are equal to the // context. An event passes the filter if all values are equal to the
// specified values. // specified values. Nested context attributes are not supported as keys. Only
// // string values are supported.
// Nested context attributes are not supported as keys. Only string values are supported.
// //
// +optional // +optional
Attributes TriggerFilterAttributes `json:"attributes,omitempty"` Attributes TriggerFilterAttributes `json:"attributes,omitempty"`
} }
// SubscriptionsAPIFilter allows defining a filter expression using CloudEvents
// Subscriptions API. If multiple filters are specified, then the same semantics
// of SubscriptionsAPIFilter.All is applied. If no filter dialect or empty
// object is specified, then the filter always accept the events.
type SubscriptionsAPIFilter struct {
// All evaluates to true if all the nested expressions evaluate to true.
// It must contain at least one filter expression.
//
// +optional
All []SubscriptionsAPIFilter `json:"all,omitempty"`
// Any evaluates to true if at least one of the nested expressions evaluates
// to true. It must contain at least one filter expression.
//
// +optional
Any []SubscriptionsAPIFilter `json:"any,omitempty"`
// Not evaluates to true if the nested expression evaluates to false.
//
// +optional
Not *SubscriptionsAPIFilter `json:"not,omitempty"`
// Exact evaluates to true if the value of the matching CloudEvents
// attribute matches exactly the String value specified (case-sensitive).
// Exact must contain exactly one property, where the key is the name of the
// CloudEvents attribute to be matched, and its value is the String value to
// use in the comparison. The attribute name and value specified in the filter
// expression cannot be empty strings.
//
// +optional
Exact map[string]string `json:"exact,omitempty"`
// Prefix evaluates to true if the value of the matching CloudEvents
// attribute starts with the String value specified (case-sensitive). Prefix
// must contain exactly one property, where the key is the name of the
// CloudEvents attribute to be matched, and its value is the String value to
// use in the comparison. The attribute name and value specified in the filter
// expression cannot be empty strings.
//
// +optional
Prefix map[string]string `json:"prefix,omitempty"`
// Suffix evaluates to true if the value of the matching CloudEvents
// attribute ends with the String value specified (case-sensitive). Suffix
// must contain exactly one property, where the key is the name of the
// CloudEvents attribute to be matched, and its value is the String value to
// use in the comparison. The attribute name and value specified in the filter
// expression cannot be empty strings.
//
// +optional
Suffix map[string]string `json:"suffix,omitempty"`
// Extensions includes the list of additional filter dialects supported by
// specific broker implementations. Check out the documentation of the
// broker implementation you're using to know about what additional filters
// are supported.
//
// +optional
Extensions map[string]*runtime.RawExtension `json:",inline"`
}
// TriggerFilterAttributes is a map of context attribute names to values for // TriggerFilterAttributes is a map of context attribute names to values for
// filtering by equality. Only exact matches will pass the filter. You can use the value '' // filtering by equality. Only exact matches will pass the filter. You can use
// to indicate all strings match. // the value '' to indicate all strings match.
type TriggerFilterAttributes map[string]string type TriggerFilterAttributes map[string]string
// TriggerStatus represents the current state of a Trigger. // TriggerStatus represents the current state of a Trigger.

View File

@ -22,10 +22,11 @@ import (
"fmt" "fmt"
"regexp" "regexp"
corev1 "k8s.io/api/core/v1"
"knative.dev/pkg/apis" "knative.dev/pkg/apis"
"knative.dev/pkg/kmp" "knative.dev/pkg/kmp"
corev1 "k8s.io/api/core/v1" "knative.dev/eventing/pkg/apis/feature"
) )
var ( var (
@ -35,7 +36,7 @@ var (
// Validate the Trigger. // Validate the Trigger.
func (t *Trigger) Validate(ctx context.Context) *apis.FieldError { func (t *Trigger) Validate(ctx context.Context) *apis.FieldError {
errs := t.Spec.Validate(ctx).ViaField("spec") errs := t.Spec.Validate(apis.WithinSpec(ctx)).ViaField("spec")
errs = t.validateAnnotation(errs, DependencyAnnotation, t.validateDependencyAnnotation) errs = t.validateAnnotation(errs, DependencyAnnotation, t.validateDependencyAnnotation)
errs = t.validateAnnotation(errs, InjectionAnnotation, t.validateInjectionAnnotation) errs = t.validateAnnotation(errs, InjectionAnnotation, t.validateInjectionAnnotation)
if apis.IsInUpdate(ctx) { if apis.IsInUpdate(ctx) {
@ -46,36 +47,20 @@ func (t *Trigger) Validate(ctx context.Context) *apis.FieldError {
} }
// Validate the TriggerSpec. // Validate the TriggerSpec.
func (ts *TriggerSpec) Validate(ctx context.Context) *apis.FieldError { func (ts *TriggerSpec) Validate(ctx context.Context) (errs *apis.FieldError) {
var errs *apis.FieldError
if ts.Broker == "" { if ts.Broker == "" {
fe := apis.ErrMissingField("broker") errs = errs.Also(apis.ErrMissingField("broker"))
errs = errs.Also(fe)
} }
if ts.Filter != nil { return errs.Also(
for attr := range map[string]string(ts.Filter.Attributes) { ValidateAttributeFilters(ts.Filter).ViaField("filter"),
if !validAttributeName.MatchString(attr) { ).Also(
fe := &apis.FieldError{ ValidateSubscriptionAPIFiltersList(ctx, ts.Filters).ViaField("filters"),
Message: fmt.Sprintf("Invalid attribute name: %q", attr), ).Also(
Paths: []string{"filter.attributes"}, ts.Subscriber.Validate(ctx).ViaField("subscriber"),
} ).Also(
errs = errs.Also(fe) ts.Delivery.Validate(ctx).ViaField("delivery"),
} )
}
}
if fe := ts.Subscriber.Validate(ctx); fe != nil {
errs = errs.Also(fe.ViaField("subscriber"))
}
if ts.Delivery != nil {
if de := ts.Delivery.Validate(ctx); de != nil {
errs = errs.Also(de.ViaField("delivery"))
}
}
return errs
} }
// CheckImmutableFields checks that any immutable fields were not changed. // CheckImmutableFields checks that any immutable fields were not changed.
@ -163,3 +148,122 @@ func (t *Trigger) validateInjectionAnnotation(injectionAnnotation string) *apis.
} }
return nil return nil
} }
func ValidateAttributeFilters(filter *TriggerFilter) (errs *apis.FieldError) {
if filter == nil {
return nil
}
return errs.Also(ValidateAttributesNames(filter.Attributes).ViaField("attributes"))
}
func ValidateAttributesNames(attrs map[string]string) (errs *apis.FieldError) {
for attr := range attrs {
if !validAttributeName.MatchString(attr) {
errs = errs.Also(apis.ErrInvalidKeyName(attr, apis.CurrentField, "Attribute name must start with a letter and can only contain lowercase alphanumeric").ViaKey(attr))
}
}
return errs
}
func ValidateSingleAttributeMap(expr map[string]string) (errs *apis.FieldError) {
if len(expr) == 0 {
return nil
}
if len(expr) != 1 {
return apis.ErrGeneric("Multiple items found, can have only one key-value", apis.CurrentField)
}
for attr := range expr {
if !validAttributeName.MatchString(attr) {
errs = errs.Also(apis.ErrInvalidKeyName(attr, apis.CurrentField, "Attribute name must start with a letter and can only contain lowercase alphanumeric").ViaKey(attr))
}
}
return errs
}
func ValidateSubscriptionAPIFiltersList(ctx context.Context, filters []SubscriptionsAPIFilter) (errs *apis.FieldError) {
if filters == nil || !feature.FromContext(ctx).IsEnabled(feature.NewTriggerFilters) {
return nil
}
for i, f := range filters {
f := f
errs = errs.Also(ValidateSubscriptionAPIFilter(ctx, &f)).ViaIndex(i)
}
return errs
}
func ValidateSubscriptionAPIFilter(ctx context.Context, filter *SubscriptionsAPIFilter) (errs *apis.FieldError) {
if filter == nil {
return nil
}
errs = errs.Also(
ValidateOneOf(filter),
).Also(
ValidateSingleAttributeMap(filter.Exact).ViaField("exact"),
).Also(
ValidateSingleAttributeMap(filter.Prefix).ViaField("prefix"),
).Also(
ValidateSingleAttributeMap(filter.Suffix).ViaField("suffix"),
).Also(
ValidateSubscriptionAPIFiltersList(ctx, filter.All).ViaField("all"),
).Also(
ValidateSubscriptionAPIFiltersList(ctx, filter.Any).ViaField("any"),
).Also(
ValidateSubscriptionAPIFilter(ctx, filter.Not).ViaField("not"),
)
return errs
}
func ValidateOneOf(filter *SubscriptionsAPIFilter) (err *apis.FieldError) {
if filter != nil && hasMultipleDialects(filter) {
return apis.ErrGeneric("multiple dialects found, filters can have only one dialect set")
}
return nil
}
func hasMultipleDialects(filter *SubscriptionsAPIFilter) bool {
dialectFound := false
if len(filter.Exact) > 0 {
dialectFound = true
}
if len(filter.Prefix) > 0 {
if dialectFound {
return true
} else {
dialectFound = true
}
}
if len(filter.Suffix) > 0 {
if dialectFound {
return true
} else {
dialectFound = true
}
}
if len(filter.All) > 0 {
if dialectFound {
return true
} else {
dialectFound = true
}
}
if len(filter.Any) > 0 {
if dialectFound {
return true
} else {
dialectFound = true
}
}
if filter.Not != nil {
if dialectFound {
return true
} else {
dialectFound = true
}
}
if len(filter.Extensions) > 0 && dialectFound {
return true
}
return false
}

View File

@ -134,6 +134,77 @@ func (in *BrokerStatus) DeepCopy() *BrokerStatus {
return out return out
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SubscriptionsAPIFilter) DeepCopyInto(out *SubscriptionsAPIFilter) {
*out = *in
if in.All != nil {
in, out := &in.All, &out.All
*out = make([]SubscriptionsAPIFilter, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Any != nil {
in, out := &in.Any, &out.Any
*out = make([]SubscriptionsAPIFilter, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Not != nil {
in, out := &in.Not, &out.Not
*out = new(SubscriptionsAPIFilter)
(*in).DeepCopyInto(*out)
}
if in.Exact != nil {
in, out := &in.Exact, &out.Exact
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.Prefix != nil {
in, out := &in.Prefix, &out.Prefix
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.Suffix != nil {
in, out := &in.Suffix, &out.Suffix
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.Extensions != nil {
in, out := &in.Extensions, &out.Extensions
*out = make(map[string]*runtime.RawExtension, len(*in))
for key, val := range *in {
var outVal *runtime.RawExtension
if val == nil {
(*out)[key] = nil
} else {
in, out := &val, &outVal
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
(*out)[key] = outVal
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionsAPIFilter.
func (in *SubscriptionsAPIFilter) DeepCopy() *SubscriptionsAPIFilter {
if in == nil {
return nil
}
out := new(SubscriptionsAPIFilter)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Trigger) DeepCopyInto(out *Trigger) { func (in *Trigger) DeepCopyInto(out *Trigger) {
*out = *in *out = *in
@ -248,6 +319,13 @@ func (in *TriggerSpec) DeepCopyInto(out *TriggerSpec) {
*out = new(TriggerFilter) *out = new(TriggerFilter)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
if in.Filters != nil {
in, out := &in.Filters, &out.Filters
*out = make([]SubscriptionsAPIFilter, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
in.Subscriber.DeepCopyInto(&out.Subscriber) in.Subscriber.DeepCopyInto(&out.Subscriber)
if in.Delivery != nil { if in.Delivery != nil {
in, out := &in.Delivery, &out.Delivery in, out := &in.Delivery, &out.Delivery

View File

@ -21,4 +21,5 @@ const (
DeliveryTimeout = "delivery-timeout" DeliveryTimeout = "delivery-timeout"
KReferenceMapping = "kreference-mapping" KReferenceMapping = "kreference-mapping"
StrictSubscriber = "strict-subscriber" StrictSubscriber = "strict-subscriber"
NewTriggerFilters = "new-trigger-filters"
) )

View File

@ -82,10 +82,10 @@ function publish_to_gcs() {
# These are global environment variables. # These are global environment variables.
SKIP_TESTS=0 SKIP_TESTS=0
PRESUBMIT_TEST_FAIL_FAST=1 PRESUBMIT_TEST_FAIL_FAST=1
TAG_RELEASE=0 export TAG_RELEASE=0
PUBLISH_RELEASE=0 PUBLISH_RELEASE=0
PUBLISH_TO_GITHUB=0 PUBLISH_TO_GITHUB=0
TAG="" export TAG=""
BUILD_COMMIT_HASH="" BUILD_COMMIT_HASH=""
BUILD_YYYYMMDD="" BUILD_YYYYMMDD=""
BUILD_TIMESTAMP="" BUILD_TIMESTAMP=""

View File

@ -105,7 +105,7 @@ func WaitForEndpointStateWithTimeout(
timeout time.Duration, timeout time.Duration,
opts ...interface{}) (*spoof.Response, error) { opts ...interface{}) (*spoof.Response, error) {
client, rOpts, err := makeSpoofClient(ctx, kubeClient, logf, url, resolvable, timeout /* true, */, opts...) client, rOpts, err := makeSpoofClient(ctx, kubeClient, logf, url, resolvable, timeout, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -152,7 +152,7 @@ func CheckEndpointState(
resolvable bool, resolvable bool,
opts ...interface{}, opts ...interface{},
) (*spoof.Response, error) { ) (*spoof.Response, error) {
client, rOpts, err := makeSpoofClient(ctx, kubeClient, logf, url, resolvable, Flags.SpoofRequestTimeout /* false, */, opts...) client, rOpts, err := makeSpoofClient(ctx, kubeClient, logf, url, resolvable, Flags.SpoofRequestTimeout, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -317,17 +317,12 @@ func ValidatePodSpec(ctx context.Context, ps corev1.PodSpec) *apis.FieldError {
errs = errs.Also(ValidatePodSecurityContext(ctx, ps.SecurityContext).ViaField("securityContext")) errs = errs.Also(ValidatePodSecurityContext(ctx, ps.SecurityContext).ViaField("securityContext"))
volumes, err := ValidateVolumes(ctx, ps.Volumes, AllMountedVolumes(append(ps.InitContainers, ps.Containers...))) volumes, err := ValidateVolumes(ctx, ps.Volumes, AllMountedVolumes(append(ps.InitContainers, ps.Containers...)))
errs = errs.Also(err.ViaField("volumes"))
errs = errs.Also(validateInitContainers(ctx, ps.InitContainers, volumes)) errs = errs.Also(validateInitContainers(ctx, ps.InitContainers, volumes))
if err != nil {
errs = errs.Also(err.ViaField("volumes"))
}
port, err := validateContainersPorts(ps.Containers) port, err := validateContainersPorts(ps.Containers)
if err != nil { errs = errs.Also(err.ViaField("containers[*]"))
errs = errs.Also(err.ViaField("containers[*]"))
}
switch len(ps.Containers) { switch len(ps.Containers) {
case 0: case 0:

View File

@ -137,6 +137,15 @@ type RevisionStatus struct {
// +optional // +optional
ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty"` ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty"`
// InitContainerStatuses is a slice of images present in .Spec.InitContainer[*].Image
// to their respective digests and their container name.
// The digests are resolved during the creation of Revision.
// ContainerStatuses holds the container name and image digests
// for both serving and non serving containers.
// ref: http://bit.ly/image-digests
// +optional
InitContainerStatuses []ContainerStatus `json:"initContainerStatuses,omitempty"`
// ActualReplicas reflects the amount of ready pods running this revision. // ActualReplicas reflects the amount of ready pods running this revision.
// +optional // +optional
ActualReplicas *int32 `json:"actualReplicas,omitempty"` ActualReplicas *int32 `json:"actualReplicas,omitempty"`

View File

@ -252,6 +252,11 @@ func (in *RevisionStatus) DeepCopyInto(out *RevisionStatus) {
*out = make([]ContainerStatus, len(*in)) *out = make([]ContainerStatus, len(*in))
copy(*out, *in) copy(*out, *in)
} }
if in.InitContainerStatuses != nil {
in, out := &in.InitContainerStatuses, &out.InitContainerStatuses
*out = make([]ContainerStatus, len(*in))
copy(*out, *in)
}
if in.ActualReplicas != nil { if in.ActualReplicas != nil {
in, out := &in.ActualReplicas, &out.ActualReplicas in, out := &in.ActualReplicas, &out.ActualReplicas
*out = new(int32) *out = new(int32)

View File

@ -220,6 +220,18 @@ func WithRevisionObservedGeneration(gen int64) RevisionOption {
} }
} }
func WithRevisionInitContainers() RevisionOption {
return func(r *v1.Revision) {
r.Spec.InitContainers = []corev1.Container{{
Name: "init1",
Image: "initimage",
}, {
Name: "init2",
Image: "initimage",
}}
}
}
// Revision creates a revision object with given ns/name and options. // Revision creates a revision object with given ns/name and options.
func Revision(namespace, name string, ro ...RevisionOption) *v1.Revision { func Revision(namespace, name string, ro ...RevisionOption) *v1.Revision {
r := &v1.Revision{ r := &v1.Revision{

10
vendor/modules.txt vendored
View File

@ -731,7 +731,7 @@ k8s.io/utils/buffer
k8s.io/utils/integer k8s.io/utils/integer
k8s.io/utils/pointer k8s.io/utils/pointer
k8s.io/utils/trace k8s.io/utils/trace
# knative.dev/eventing v0.27.1-0.20211109172546-31e4e2eb26d1 # knative.dev/eventing v0.27.1-0.20211116113552-12418535e186
## explicit ## explicit
knative.dev/eventing/pkg/apis/config knative.dev/eventing/pkg/apis/config
knative.dev/eventing/pkg/apis/duck knative.dev/eventing/pkg/apis/duck
@ -757,10 +757,10 @@ knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1
knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1/fake knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1/fake
knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2 knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2
knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2/fake knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2/fake
# knative.dev/hack v0.0.0-20211108170701-96aac1c30be3 # knative.dev/hack v0.0.0-20211112192837-128cf0150a69
## explicit ## explicit
knative.dev/hack knative.dev/hack
# knative.dev/networking v0.0.0-20211109174044-1507a59cf35c # knative.dev/networking v0.0.0-20211116075352-3f45c8b29bc1
## explicit ## explicit
knative.dev/networking/pkg knative.dev/networking/pkg
knative.dev/networking/pkg/apis/networking knative.dev/networking/pkg/apis/networking
@ -768,7 +768,7 @@ knative.dev/networking/pkg/apis/networking/v1alpha1
knative.dev/networking/pkg/client/clientset/versioned knative.dev/networking/pkg/client/clientset/versioned
knative.dev/networking/pkg/client/clientset/versioned/scheme knative.dev/networking/pkg/client/clientset/versioned/scheme
knative.dev/networking/pkg/client/clientset/versioned/typed/networking/v1alpha1 knative.dev/networking/pkg/client/clientset/versioned/typed/networking/v1alpha1
# knative.dev/pkg v0.0.0-20211109100843-91d1932616a7 # knative.dev/pkg v0.0.0-20211115071955-517ef0292b53
## explicit ## explicit
knative.dev/pkg/apis knative.dev/pkg/apis
knative.dev/pkg/apis/duck knative.dev/pkg/apis/duck
@ -817,7 +817,7 @@ knative.dev/pkg/tracing/config
knative.dev/pkg/tracing/propagation knative.dev/pkg/tracing/propagation
knative.dev/pkg/tracing/propagation/tracecontextb3 knative.dev/pkg/tracing/propagation/tracecontextb3
knative.dev/pkg/tracker knative.dev/pkg/tracker
# knative.dev/serving v0.27.1-0.20211109195444-c02ef3147516 # knative.dev/serving v0.27.1-0.20211116120552-dae92fcaf11a
## explicit ## explicit
knative.dev/serving/pkg/apis/autoscaling knative.dev/serving/pkg/apis/autoscaling
knative.dev/serving/pkg/apis/autoscaling/v1alpha1 knative.dev/serving/pkg/apis/autoscaling/v1alpha1