diff --git a/go.mod b/go.mod index 724048c7ff..77e1370dc6 100644 --- a/go.mod +++ b/go.mod @@ -37,10 +37,10 @@ require ( k8s.io/api v0.17.6 k8s.io/apimachinery v0.17.6 k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible - knative.dev/eventing v0.15.1-0.20200528004559-c607c293b2a5 - knative.dev/pkg v0.0.0-20200527173759-2d1a04d1ff82 - knative.dev/serving v0.15.1-0.20200528080059-a1de2b9fa410 - knative.dev/test-infra v0.0.0-20200527191759-5ba38edc41ae + knative.dev/eventing v0.15.1-0.20200529161002-7b930d1b5057 + knative.dev/pkg v0.0.0-20200528190300-08a86da47d28 + knative.dev/serving v0.15.1-0.20200529155502-1b878b36836e + knative.dev/test-infra v0.0.0-20200528222301-350178ab2a0e ) replace ( diff --git a/go.sum b/go.sum index a7f507e917..66753b293b 100644 --- a/go.sum +++ b/go.sum @@ -1559,8 +1559,8 @@ k8s.io/utils v0.0.0-20200124190032-861946025e34 h1:HjlUD6M0K3P8nRXmr2B9o4F9dUy9T k8s.io/utils v0.0.0-20200124190032-861946025e34/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= knative.dev/caching v0.0.0-20190719140829-2032732871ff/go.mod h1:dHXFU6CGlLlbzaWc32g80cR92iuBSpsslDNBWI8C7eg= knative.dev/caching v0.0.0-20200521155757-e78d17bc250e/go.mod h1:bsKPIG2XZFYL8uw5BAxg7EMBLp0vNpu9jZIGus8HUPU= -knative.dev/eventing v0.15.1-0.20200528004559-c607c293b2a5 h1:E+TFONz3UFQGEduwcUDGN619c4Se7LeUi/FogeU5wfE= -knative.dev/eventing v0.15.1-0.20200528004559-c607c293b2a5/go.mod h1:q2XG7081UX1xW1AEGmKz2PUdhB8t00PjBEdhAuO/IE0= +knative.dev/eventing v0.15.1-0.20200529161002-7b930d1b5057 h1:U0Ry/j8uGRHDxcqpsM7f5S0O/08tHy7TDnE6nsvgwZA= +knative.dev/eventing v0.15.1-0.20200529161002-7b930d1b5057/go.mod h1:q2XG7081UX1xW1AEGmKz2PUdhB8t00PjBEdhAuO/IE0= knative.dev/eventing-contrib v0.6.1-0.20190723221543-5ce18048c08b/go.mod h1:SnXZgSGgMSMLNFTwTnpaOH7hXDzTFtw0J8OmHflNx3g= knative.dev/pkg v0.0.0-20191101194912-56c2594e4f11/go.mod h1:pgODObA1dTyhNoFxPZTTjNWfx6F0aKsKzn+vaT9XO/Q= knative.dev/pkg v0.0.0-20191111150521-6d806b998379/go.mod h1:pgODObA1dTyhNoFxPZTTjNWfx6F0aKsKzn+vaT9XO/Q= @@ -1574,8 +1574,10 @@ knative.dev/pkg v0.0.0-20200520073958-94316e20e860/go.mod h1:QgNZTxnwpB/oSpNcfnL knative.dev/pkg v0.0.0-20200527024749-495174c96651/go.mod h1:4ipprwHqpqiyYHbrEjSf1kNwL+sJOqHhj1ujO2WxvpE= knative.dev/pkg v0.0.0-20200527173759-2d1a04d1ff82 h1:uC65bOUmC5UsVJgUI28QWis/oiqnZrU49wLM828ioJM= knative.dev/pkg v0.0.0-20200527173759-2d1a04d1ff82/go.mod h1:ywZfX/0D8hoOf4uJVgeEvJpSmsOauQvr1IuAWld9UjM= -knative.dev/serving v0.15.1-0.20200528080059-a1de2b9fa410 h1:f4FmbgnyFyXGfBPB2ARIMJ77W3hgNqWwIA7M6Gbcq+s= -knative.dev/serving v0.15.1-0.20200528080059-a1de2b9fa410/go.mod h1:R4ajt2UAbNCdXrQPj1l8DcpJMtDKqS+Pc3H3cvL0TkU= +knative.dev/pkg v0.0.0-20200528190300-08a86da47d28 h1:tLWWfrpGYT8vs/QLWYc7s0pqaw+ISz4UmM9AhrWBc8o= +knative.dev/pkg v0.0.0-20200528190300-08a86da47d28/go.mod h1:ywZfX/0D8hoOf4uJVgeEvJpSmsOauQvr1IuAWld9UjM= +knative.dev/serving v0.15.1-0.20200529155502-1b878b36836e h1:mhFy2oNaBq3vS9EzrCtigw67m40QN8E0dyEITx20pdQ= +knative.dev/serving v0.15.1-0.20200529155502-1b878b36836e/go.mod h1:ebxxoSXTWJjCBdyb3P6KU0kNuVEAUMi22OI2E7mAxxY= knative.dev/test-infra v0.0.0-20200407185800-1b88cb3b45a5 h1:BEfxItc0hPeQmojxoiOwbCbmdVz0+L2SYWKUSQeFF8g= knative.dev/test-infra v0.0.0-20200407185800-1b88cb3b45a5/go.mod h1:xcdUkMJrLlBswIZqL5zCuBFOC22WIPMQoVX1L35i0vQ= knative.dev/test-infra v0.0.0-20200505052144-5ea2f705bb55/go.mod h1:WqF1Azka+FxPZ20keR2zCNtiQA1MP9ZB4BH4HuI+SIU= @@ -1586,8 +1588,8 @@ knative.dev/test-infra v0.0.0-20200519161858-554a95a37986/go.mod h1:LeNa1Wvn47ef knative.dev/test-infra v0.0.0-20200522180958-6a0a9b9d893a/go.mod h1:n9eQkzmSNj8BiqNFl1lzoz68D09uMeJfyOjc132Gbik= knative.dev/test-infra v0.0.0-20200527185659-fc87694eb879 h1:3spi67ya78+ofPZLHpJkZlBSj6pBowXa8/1Zdha6MCY= knative.dev/test-infra v0.0.0-20200527185659-fc87694eb879/go.mod h1:7JtOmoYiYxh2oFO23nwGanuJ6qT6mFrRlZV1LL6gomY= -knative.dev/test-infra v0.0.0-20200527191759-5ba38edc41ae h1:6K0AMdNnrSrRqFaBJGbE/xRBPC5n9I9DXTV/hMyCK3k= -knative.dev/test-infra v0.0.0-20200527191759-5ba38edc41ae/go.mod h1:7JtOmoYiYxh2oFO23nwGanuJ6qT6mFrRlZV1LL6gomY= +knative.dev/test-infra v0.0.0-20200528222301-350178ab2a0e h1:ZzmzPgCKdrFg2MA2sGtd9HrlIQ7XidnmMJB8RDEduO0= +knative.dev/test-infra v0.0.0-20200528222301-350178ab2a0e/go.mod h1:7JtOmoYiYxh2oFO23nwGanuJ6qT6mFrRlZV1LL6gomY= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/register.go b/vendor/knative.dev/eventing/pkg/apis/eventing/register.go index 802e5f0216..7aa995c784 100644 --- a/vendor/knative.dev/eventing/pkg/apis/eventing/register.go +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/register.go @@ -29,11 +29,6 @@ const ( // which Controller is responsible for them. BrokerClassKey = GroupName + "/broker.class" - // ChannelBrokerClassValue is the value we use to specify the - // Broker using channels. As in Broker from this repository - // pkg/reconciler/broker - ChannelBrokerClassValue = "ChannelBasedBroker" - // MTChannelBrokerClassValue is the value we use to specify the // Broker using channels, but the resources (ingress,filter) run // in the system namespace. As in Broker from this repository diff --git a/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/channel_lifecycle.go b/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/channel_lifecycle.go index 5bdc25a8d6..c206fdd3f9 100644 --- a/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/channel_lifecycle.go +++ b/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/channel_lifecycle.go @@ -38,8 +38,13 @@ const ( ChannelConditionAddressable apis.ConditionType = "Addressable" ) +// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface. +func (*Channel) GetConditionSet() apis.ConditionSet { + return chCondSet +} + // GetGroupVersionKind returns GroupVersionKind for Channels. -func (dc *Channel) GetGroupVersionKind() schema.GroupVersionKind { +func (*Channel) GetGroupVersionKind() schema.GroupVersionKind { return SchemeGroupVersion.WithKind("Channel") } diff --git a/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/channel_types.go b/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/channel_types.go index b380063115..90d5450fdc 100644 --- a/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/channel_types.go +++ b/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/channel_types.go @@ -56,6 +56,9 @@ var ( // Check that we can create OwnerReferences to a Channel. _ kmeta.OwnerRefable = (*Channel)(nil) + + // Check that the type conforms to the duck Knative Resource shape. + _ duckv1.KRShaped = (*Channel)(nil) ) // ChannelSpec defines which subscribers have expressed interest in receiving events from this Channel. @@ -87,3 +90,8 @@ type ChannelList struct { metav1.ListMeta `json:"metadata,omitempty"` Items []Channel `json:"items"` } + +// GetStatus retrieves the status of the Channel. Implements the KRShaped interface. +func (t *Channel) GetStatus() *duckv1.Status { + return &t.Status.Status +} diff --git a/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/in_memory_channel_lifecycle.go b/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/in_memory_channel_lifecycle.go index ad719924c6..7ff31f0d3b 100644 --- a/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/in_memory_channel_lifecycle.go +++ b/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/in_memory_channel_lifecycle.go @@ -53,8 +53,13 @@ const ( InMemoryChannelConditionChannelServiceReady apis.ConditionType = "ChannelServiceReady" ) +// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface. +func (*InMemoryChannel) GetConditionSet() apis.ConditionSet { + return imcCondSet +} + // GetGroupVersionKind returns GroupVersionKind for InMemoryChannels -func (imc *InMemoryChannel) GetGroupVersionKind() schema.GroupVersionKind { +func (*InMemoryChannel) GetGroupVersionKind() schema.GroupVersionKind { return SchemeGroupVersion.WithKind("InMemoryChannel") } diff --git a/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/in_memory_channel_types.go b/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/in_memory_channel_types.go index c7097ab3d7..53cd7d6375 100644 --- a/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/in_memory_channel_types.go +++ b/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/in_memory_channel_types.go @@ -21,6 +21,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" eventingduckv1beta1 "knative.dev/eventing/pkg/apis/duck/v1beta1" "knative.dev/pkg/apis" + duckv1 "knative.dev/pkg/apis/duck/v1" "knative.dev/pkg/kmeta" ) @@ -55,6 +56,9 @@ var ( // Check that we can create OwnerReferences to an InMemoryChannel. _ kmeta.OwnerRefable = (*InMemoryChannel)(nil) + + // Check that the type conforms to the duck Knative Resource shape. + _ duckv1.KRShaped = (*InMemoryChannel)(nil) ) // InMemoryChannelSpec defines which subscribers have expressed interest in @@ -80,3 +84,8 @@ type InMemoryChannelList struct { metav1.ListMeta `json:"metadata,omitempty"` Items []InMemoryChannel `json:"items"` } + +// GetStatus retrieves the status of the InMemoryChannel. Implements the KRShaped interface. +func (t *InMemoryChannel) GetStatus() *duckv1.Status { + return &t.Status.Status +} diff --git a/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/subscription_lifecycle.go b/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/subscription_lifecycle.go index 3ea41c63ef..75b5d78b65 100644 --- a/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/subscription_lifecycle.go +++ b/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/subscription_lifecycle.go @@ -20,7 +20,7 @@ import ( "knative.dev/pkg/apis" ) -// subCondSet is a condition set with Ready as the happy condition and +// SubCondSet is a condition set with Ready as the happy condition and // ReferencesResolved and ChannelReady as the dependent conditions. var SubCondSet = apis.NewLivingConditionSet(SubscriptionConditionReferencesResolved, SubscriptionConditionAddedToChannel, SubscriptionConditionChannelReady) @@ -39,6 +39,11 @@ const ( SubscriptionConditionChannelReady apis.ConditionType = "ChannelReady" ) +// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface. +func (*Subscription) GetConditionSet() apis.ConditionSet { + return SubCondSet +} + // GetCondition returns the condition currently associated with the given type, or nil. func (ss *SubscriptionStatus) GetCondition(t apis.ConditionType) *apis.Condition { return SubCondSet.Manage(ss).GetCondition(t) diff --git a/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/subscription_types.go b/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/subscription_types.go index 70f3c9c0cd..79c361fafd 100644 --- a/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/subscription_types.go +++ b/vendor/knative.dev/eventing/pkg/apis/messaging/v1beta1/subscription_types.go @@ -54,6 +54,9 @@ var ( // Check that we can create OwnerReferences to a Subscription. _ kmeta.OwnerRefable = (*Subscription)(nil) + + // Check that the type conforms to the duck Knative Resource shape. + _ duckv1.KRShaped = (*Subscription)(nil) ) // SubscriptionSpec specifies the Channel for incoming events, a Subscriber target @@ -138,7 +141,7 @@ type SubscriptionList struct { } // GetGroupVersionKind returns GroupVersionKind for Subscriptions -func (t *Subscription) GetGroupVersionKind() schema.GroupVersionKind { +func (*Subscription) GetGroupVersionKind() schema.GroupVersionKind { return SchemeGroupVersion.WithKind("Subscription") } @@ -146,3 +149,8 @@ func (t *Subscription) GetGroupVersionKind() schema.GroupVersionKind { func (s *Subscription) GetUntypedSpec() interface{} { return s.Spec } + +// GetStatus retrieves the status of the Subscription. Implements the KRShaped interface. +func (s *Subscription) GetStatus() *duckv1.Status { + return &s.Status.Status +} diff --git a/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/broker.go b/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/broker.go deleted file mode 100644 index 4e9a229196..0000000000 --- a/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/broker.go +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright 2019 The Knative Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resources - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - "knative.dev/eventing/pkg/apis/eventing/v1beta1" -) - -// MakeBroker creates a default Broker object for Namespace 'namespace'. -func MakeBroker(ns *corev1.Namespace) *v1beta1.Broker { - return &v1beta1.Broker{ - ObjectMeta: metav1.ObjectMeta{ - OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(ns.GetObjectMeta(), schema.GroupVersionKind{ - Group: corev1.SchemeGroupVersion.Group, - Version: corev1.SchemeGroupVersion.Version, - Kind: "Namespace", - }), - }, - Namespace: ns.Name, - Name: DefaultBrokerName, - Labels: OwnedLabels(), - }, - } -} diff --git a/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/configmappropagation.go b/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/configmappropagation.go deleted file mode 100644 index e33cbab930..0000000000 --- a/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/configmappropagation.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 2020 The Knative Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resources - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - "knative.dev/eventing/pkg/apis/configs/v1alpha1" - "knative.dev/pkg/system" -) - -// MakeConfigMapPropagation creates a default ConfigMapPropagation object for Namespace 'namespace'. -func MakeConfigMapPropagation(namespace *corev1.Namespace) *v1alpha1.ConfigMapPropagation { - return &v1alpha1.ConfigMapPropagation{ - ObjectMeta: metav1.ObjectMeta{ - OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(namespace.GetObjectMeta(), schema.GroupVersionKind{ - Group: corev1.SchemeGroupVersion.Group, - Version: corev1.SchemeGroupVersion.Version, - Kind: "Namespace", - }), - }, - Namespace: namespace.Name, - Name: DefaultConfigMapPropagationName, - }, - Spec: v1alpha1.ConfigMapPropagationSpec{ - OriginalNamespace: system.Namespace(), - Selector: &metav1.LabelSelector{MatchLabels: ConfigMapPropagationOwnedLabels()}, - }, - } -} diff --git a/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/labels.go b/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/labels.go deleted file mode 100644 index 4512b5e2b0..0000000000 --- a/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/labels.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright 2019 The Knative Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resources - -const ( - // Label to enable knative-eventing in a namespace. - InjectionLabelKey = "knative-eventing-injection" - InjectionEnabledLabelValue = "enabled" - InjectionDisabledLabelValue = "disabled" - InjectedResourceLabel = "eventing.knative.dev/namespaceInjected" - CmpDefaultLabelKey = "knative.dev/config-category" - CmpDefaultLabelValue = "eventing" -) - -// OwnedLabels generates the labels present on injected broker resources. -func OwnedLabels() map[string]string { - return map[string]string{ - InjectedResourceLabel: "true", - } -} - -// ConfigMapPropagationOwnedLabels generates the labels present on injected broker resources. -func ConfigMapPropagationOwnedLabels() map[string]string { - return map[string]string{ - CmpDefaultLabelKey: CmpDefaultLabelValue, - } -} - -func InjectionEnabledLabels() map[string]string { - return map[string]string{ - InjectionLabelKey: InjectionEnabledLabelValue, - } -} - -func InjectionDisabledLabels() map[string]string { - return map[string]string{ - InjectionLabelKey: InjectionDisabledLabelValue, - } -} diff --git a/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/names.go b/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/names.go deleted file mode 100644 index 5f7e36a04e..0000000000 --- a/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/names.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2019 The Knative Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resources - -const ( - DefaultBrokerName = "default" - - FilterServiceAccountName = "eventing-broker-filter" - FilterRoleBindingName = "eventing-broker-filter" - FilterClusterRoleName = "eventing-broker-filter" - - IngressServiceAccountName = "eventing-broker-ingress" - IngressRoleBindingName = "eventing-broker-ingress" - IngressClusterRoleName = "eventing-broker-ingress" - - DefaultConfigMapPropagationName = "eventing" -) diff --git a/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/role_binding.go b/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/role_binding.go deleted file mode 100644 index 776d857191..0000000000 --- a/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/role_binding.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2019 The Knative Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resources - -import ( - corev1 "k8s.io/api/core/v1" - rbacv1 "k8s.io/api/rbac/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// MakeRoleBinding creates a RoleBinding object for the Broker's filter -// service account 'sa' in the Namespace 'ns'. -func MakeRoleBinding(name string, ns *corev1.Namespace, nsName string, sa *corev1.ServiceAccount, clusterRoleName string) *rbacv1.RoleBinding { - return &rbacv1.RoleBinding{ - ObjectMeta: metav1.ObjectMeta{ - OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(ns.GetObjectMeta(), schema.GroupVersionKind{ - Group: corev1.SchemeGroupVersion.Group, - Version: corev1.SchemeGroupVersion.Version, - Kind: "Namespace", - }), - }, - Name: name, - Namespace: nsName, - Labels: OwnedLabels(), - }, - RoleRef: rbacv1.RoleRef{ - APIGroup: "rbac.authorization.k8s.io", - Kind: "ClusterRole", - Name: clusterRoleName, - }, - Subjects: []rbacv1.Subject{ - { - Kind: "ServiceAccount", - Namespace: sa.Namespace, - Name: sa.Name, - }, - }, - } -} diff --git a/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/secret.go b/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/secret.go deleted file mode 100644 index d1fbb14f3f..0000000000 --- a/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/secret.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2019 The Knative Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resources - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// MakeSecret creates a Secret object. -func MakeSecret(name string) *corev1.Secret { - return &corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - }, - } -} diff --git a/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/service_account.go b/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/service_account.go deleted file mode 100644 index bbcaed2bae..0000000000 --- a/vendor/knative.dev/eventing/pkg/reconciler/namespace/resources/service_account.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright 2019 The Knative Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resources - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// MakeServiceAccount creates a ServiceAccount object for the Namespace 'ns'. -func MakeServiceAccount(namespace *corev1.Namespace, name string) *corev1.ServiceAccount { - return &corev1.ServiceAccount{ - ObjectMeta: metav1.ObjectMeta{ - OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(namespace.GetObjectMeta(), schema.GroupVersionKind{ - Group: corev1.SchemeGroupVersion.Group, - Version: corev1.SchemeGroupVersion.Version, - Kind: "Namespace", - }), - }, - Namespace: namespace.Name, - Name: name, - Labels: OwnedLabels(), - }, - } -} diff --git a/vendor/knative.dev/eventing/test/conformance/helpers/broker_tracing_test_helper.go b/vendor/knative.dev/eventing/test/conformance/helpers/broker_tracing_test_helper.go index 292115496d..abcd3b132f 100644 --- a/vendor/knative.dev/eventing/test/conformance/helpers/broker_tracing_test_helper.go +++ b/vendor/knative.dev/eventing/test/conformance/helpers/broker_tracing_test_helper.go @@ -26,7 +26,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" - "knative.dev/eventing/pkg/apis/eventing" "knative.dev/eventing/pkg/apis/eventing/v1alpha1" "knative.dev/eventing/pkg/apis/eventing/v1beta1" tracinghelper "knative.dev/eventing/test/conformance/helpers/tracing" @@ -83,12 +82,6 @@ func setupBrokerTracing(brokerClass string) SetupInfrastructureFunc { loggerPodName string, tc TracingTestCase, ) (tracinghelper.TestSpanTree, lib.EventMatchFunc) { - // Create the Broker. - if brokerClass == eventing.ChannelBrokerClassValue { - // create required RBAC resources including ServiceAccounts and ClusterRoleBindings for Brokers - client.CreateConfigMapPropagationOrFail(defaultCMPName) - client.CreateRBACResourcesForBrokers() - } // Create a configmap used by the broker. client.CreateBrokerConfigMapOrFail("br", channel) diff --git a/vendor/knative.dev/eventing/test/e2e-common.sh b/vendor/knative.dev/eventing/test/e2e-common.sh index 12772e17a8..f4569e9edf 100644 --- a/vendor/knative.dev/eventing/test/e2e-common.sh +++ b/vendor/knative.dev/eventing/test/e2e-common.sh @@ -111,12 +111,6 @@ function install_latest_release() { fail_test "Knative latest release installation failed" } -function install_broker() { - ko apply --strict -f ${CHANNEL_BASED_BROKER_DEFAULT_CONFIG} || return 1 - ko apply --strict -f ${CHANNEL_BASED_BROKER_CONTROLLER} || return 1 - wait_until_pods_running knative-eventing || fail_test "Knative Eventing with Broker did not come up" -} - function run_postinstall() { ko apply --strict -f ${POST_INSTALL_V015} || return 1 wait_until_batch_job_complete knative-eventing || return 1 @@ -130,10 +124,6 @@ function install_mt_broker() { wait_until_pods_running knative-eventing || fail_test "Knative Eventing with MT Broker did not come up" } -function uninstall_broker() { - ko delete -f ${CHANNEL_BASED_BROKER_CONTROLLER} || return 1 -} - # Teardown the Knative environment after tests finish. function knative_teardown() { echo ">> Stopping Knative Eventing" diff --git a/vendor/knative.dev/eventing/test/e2e-tests.sh b/vendor/knative.dev/eventing/test/e2e-tests.sh index 00ac825e3a..231a56f8cf 100644 --- a/vendor/knative.dev/eventing/test/e2e-tests.sh +++ b/vendor/knative.dev/eventing/test/e2e-tests.sh @@ -32,13 +32,6 @@ source "$(dirname "$0")/e2e-common.sh" initialize $@ --skip-istio-addon -install_broker || fail_test "Could not install Channel Based Broker" - -echo "Running tests with Channel Based Broker" -go_test_e2e -timeout=20m -parallel=12 ./test/e2e ./test/conformance -brokerclass=ChannelBasedBroker -channels=messaging.knative.dev/v1alpha1:InMemoryChannel,messaging.knative.dev/v1alpha1:Channel,messaging.knative.dev/v1beta1:InMemoryChannel || fail_test - -uninstall_broker || fail_test "Could not uninstall Channel Based Broker" - install_mt_broker || fail_test "Could not uninstall MT Channel Based Broker" echo "Running tests with Multi Tenant Channel Based Broker" diff --git a/vendor/knative.dev/eventing/test/e2e-upgrade-tests.sh b/vendor/knative.dev/eventing/test/e2e-upgrade-tests.sh index 50865996c1..1600a2c459 100644 --- a/vendor/knative.dev/eventing/test/e2e-upgrade-tests.sh +++ b/vendor/knative.dev/eventing/test/e2e-upgrade-tests.sh @@ -57,7 +57,7 @@ wait_for_file /tmp/prober-ready || fail_test header "Performing upgrade to HEAD" install_head || fail_test 'Installing HEAD version of eventing failed' install_channel_crds || fail_test 'Installing HEAD channel CRDs failed' -install_broker || fail_test 'Installing HEAD Broker failed' +install_mt_broker || fail_test 'Installing HEAD Broker failed' run_postinstall || fail_test 'Running postinstall failed' diff --git a/vendor/knative.dev/eventing/test/e2e/helpers/broker_channel_flow_test_helper.go b/vendor/knative.dev/eventing/test/e2e/helpers/broker_channel_flow_test_helper.go index c3b3ca600f..738ad1b752 100644 --- a/vendor/knative.dev/eventing/test/e2e/helpers/broker_channel_flow_test_helper.go +++ b/vendor/knative.dev/eventing/test/e2e/helpers/broker_channel_flow_test_helper.go @@ -22,7 +22,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" - "knative.dev/eventing/pkg/apis/eventing" "knative.dev/eventing/pkg/apis/eventing/v1alpha1" "knative.dev/eventing/test/lib" "knative.dev/eventing/test/lib/cloudevents" @@ -61,11 +60,6 @@ func BrokerChannelFlowTestHelper(t *testing.T, client := lib.Setup(st, true, options...) defer lib.TearDown(client) - if brokerClass == eventing.ChannelBrokerClassValue { - // create required RBAC resources including ServiceAccounts and ClusterRoleBindings for Brokers - client.CreateRBACResourcesForBrokers() - } - // Create a configmap used by the broker. client.CreateBrokerConfigMapOrFail(brokerName, &channel) diff --git a/vendor/knative.dev/eventing/test/e2e/helpers/broker_dls_test_helper.go b/vendor/knative.dev/eventing/test/e2e/helpers/broker_dls_test_helper.go index 1419c409ee..c3c652b24e 100644 --- a/vendor/knative.dev/eventing/test/e2e/helpers/broker_dls_test_helper.go +++ b/vendor/knative.dev/eventing/test/e2e/helpers/broker_dls_test_helper.go @@ -21,7 +21,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "knative.dev/eventing/pkg/apis/eventing" "knative.dev/eventing/test/lib" "knative.dev/eventing/test/lib/cloudevents" "knative.dev/eventing/test/lib/resources" @@ -49,12 +48,6 @@ func BrokerDeadLetterSinkTestHelper(t *testing.T, client := lib.Setup(st, true, options...) defer lib.TearDown(client) - if brokerClass == eventing.ChannelBrokerClassValue { - // create required RBAC resources including ServiceAccounts and ClusterRoleBindings for Brokers - // create required RBAC resources including ServiceAccounts and ClusterRoleBindings for Brokers - client.CreateRBACResourcesForBrokers() - } - // create logger pod and service for deadlettersink loggerPod := resources.EventLoggerPod(loggerPodName) client.CreatePodOrFail(loggerPod, lib.WithService(loggerPodName)) diff --git a/vendor/knative.dev/eventing/test/e2e/helpers/broker_event_transformation_test_helper.go b/vendor/knative.dev/eventing/test/e2e/helpers/broker_event_transformation_test_helper.go index 555c5195b7..44c5003228 100644 --- a/vendor/knative.dev/eventing/test/e2e/helpers/broker_event_transformation_test_helper.go +++ b/vendor/knative.dev/eventing/test/e2e/helpers/broker_event_transformation_test_helper.go @@ -22,7 +22,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" - "knative.dev/eventing/pkg/apis/eventing" "knative.dev/eventing/pkg/apis/eventing/v1alpha1" "knative.dev/eventing/test/lib" "knative.dev/eventing/test/lib/cloudevents" @@ -56,11 +55,6 @@ func EventTransformationForTriggerTestHelper(t *testing.T, client := lib.Setup(st, true, options...) defer lib.TearDown(client) - if brokerClass == eventing.ChannelBrokerClassValue { - // create required RBAC resources including ServiceAccounts and ClusterRoleBindings for Brokers - client.CreateRBACResourcesForBrokers() - } - // Create a configmap used by the broker. config := client.CreateBrokerConfigMapOrFail(brokerName, &channel) diff --git a/vendor/knative.dev/eventing/test/e2e/helpers/broker_test_helper.go b/vendor/knative.dev/eventing/test/e2e/helpers/broker_test_helper.go index 7d044b85c5..e52212fb19 100644 --- a/vendor/knative.dev/eventing/test/e2e/helpers/broker_test_helper.go +++ b/vendor/knative.dev/eventing/test/e2e/helpers/broker_test_helper.go @@ -22,8 +22,6 @@ import ( "strings" "testing" - "knative.dev/eventing/pkg/apis/eventing" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/eventing/pkg/apis/eventing/v1alpha1" "knative.dev/eventing/test/lib" @@ -67,12 +65,6 @@ type BrokerCreator func(client *lib.Client) string // ChannelBasedBrokerCreator creates a BrokerCreator that creates a broker based on the channel parameter. func ChannelBasedBrokerCreator(channel metav1.TypeMeta, brokerClass string) BrokerCreator { return func(client *lib.Client) string { - - if brokerClass == eventing.ChannelBrokerClassValue { - // create required RBAC resources including ServiceAccounts and ClusterRoleBindings for Brokers. - client.CreateRBACResourcesForBrokers() - } - brokerName := strings.ToLower(channel.Kind) // create a ConfigMap used by the broker. diff --git a/vendor/knative.dev/eventing/test/e2e/helpers/broker_with_config_helper.go b/vendor/knative.dev/eventing/test/e2e/helpers/broker_with_config_helper.go index 56f56edc8d..02ffbf1d0c 100644 --- a/vendor/knative.dev/eventing/test/e2e/helpers/broker_with_config_helper.go +++ b/vendor/knative.dev/eventing/test/e2e/helpers/broker_with_config_helper.go @@ -22,7 +22,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" - "knative.dev/eventing/pkg/apis/eventing" "knative.dev/eventing/pkg/apis/eventing/v1alpha1" "knative.dev/eventing/test/lib" "knative.dev/eventing/test/lib/cloudevents" @@ -61,11 +60,6 @@ func TestBrokerWithConfig(t *testing.T, client := lib.Setup(st, true, options...) defer lib.TearDown(client) - if brokerClass == eventing.ChannelBrokerClassValue { - // create required RBAC resources including ServiceAccounts and ClusterRoleBindings for Brokers - client.CreateRBACResourcesForBrokers() - } - config := client.CreateBrokerConfigMapOrFail(brokerName, &channel) //&channel diff --git a/vendor/knative.dev/eventing/test/e2e/helpers/channel_defaulter_test_helper.go b/vendor/knative.dev/eventing/test/e2e/helpers/channel_defaulter_test_helper.go index 2effd5f63a..8473514868 100644 --- a/vendor/knative.dev/eventing/test/e2e/helpers/channel_defaulter_test_helper.go +++ b/vendor/knative.dev/eventing/test/e2e/helpers/channel_defaulter_test_helper.go @@ -23,6 +23,7 @@ import ( "github.com/ghodss/yaml" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/uuid" eventingduck "knative.dev/eventing/pkg/apis/duck/v1alpha1" @@ -114,8 +115,24 @@ func defaultChannelTestHelper(t *testing.T, client *lib.Client, expectedChannel if err != nil { t.Fatalf("Failed to list the underlying channels: %v", err) } - if len(objs) != 1 { - t.Fatalf("The defaultchannel is expected to create 1 underlying channel, but got %d", len(objs)) + + // Note that since by default MT ChannelBroker creates a Broker in each namespace, there's + // actually two channels. + // https://github.com/knative/eventing/issues/3138 + // So, filter out the broker channel from the list before checking that there's only one. + filteredObjs := make([]runtime.Object, 0) + for _, o := range objs { + if o.(*eventingduck.SubscribableType).Name != "default-kne-trigger" { + filteredObjs = append(filteredObjs, o) + } + } + + if len(filteredObjs) != 1 { + t.Logf("Got unexpected channels:") + for i, ec := range filteredObjs { + t.Logf("Extra channels: %d : %+v", i, ec) + } + t.Fatalf("The defaultchannel is expected to create 1 underlying channel, but got %d", len(filteredObjs)) } // send fake CloudEvent to the channel diff --git a/vendor/knative.dev/eventing/test/e2e_flags.go b/vendor/knative.dev/eventing/test/e2e_flags.go index 6af8e9d160..9397a67d5b 100644 --- a/vendor/knative.dev/eventing/test/e2e_flags.go +++ b/vendor/knative.dev/eventing/test/e2e_flags.go @@ -77,7 +77,7 @@ type EventingEnvironmentFlags struct { // go1.13+, see https://github.com/knative/test-infra/issues/1329 for details func InitializeEventingFlags() { flag.Var(&EventingFlags.Channels, "channels", "The names of the channel type metas, separated by comma. Example: \"messaging.knative.dev/v1alpha1:InMemoryChannel,messaging.cloud.google.com/v1alpha1:Channel,messaging.knative.dev/v1alpha1:KafkaChannel\".") - flag.StringVar(&EventingFlags.BrokerClass, "brokerclass", "ChannelBasedBroker", "Which brokerclass to test, requires the proper Broker implementation to have been installed, and only one value. brokerclass can be one of 'ChannelBasedBroker' or 'MTChannelBasedBroker'.") + flag.StringVar(&EventingFlags.BrokerClass, "brokerclass", "MTChannelBasedBroker", "Which brokerclass to test, requires the proper Broker implementation to have been installed, and only one value. brokerclass must be (for now) 'MTChannelBasedBroker'.") flag.Parse() // If no channel is passed through the flag, initialize it as the DefaultChannel. @@ -89,7 +89,7 @@ func InitializeEventingFlags() { log.Fatalf("Brokerclass not specified") } - if EventingFlags.BrokerClass != "ChannelBasedBroker" && EventingFlags.BrokerClass != "MTChannelBasedBroker" { - log.Fatalf("Invalid Brokerclass specified, got %q must be either %q or %q", EventingFlags.BrokerClass, "ChannelBasedBroker", "MTChannelBasedBroker") + if EventingFlags.BrokerClass != "MTChannelBasedBroker" { + log.Fatalf("Invalid Brokerclass specified, got %q must be %q", EventingFlags.BrokerClass, "MTChannelBasedBroker") } } diff --git a/vendor/knative.dev/eventing/test/lib/creation.go b/vendor/knative.dev/eventing/test/lib/creation.go index b823624d0f..a046213f81 100644 --- a/vendor/knative.dev/eventing/test/lib/creation.go +++ b/vendor/knative.dev/eventing/test/lib/creation.go @@ -28,7 +28,6 @@ import ( "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - configsv1alpha1 "knative.dev/eventing/pkg/apis/configs/v1alpha1" "knative.dev/eventing/pkg/apis/eventing/v1alpha1" "knative.dev/eventing/pkg/apis/eventing/v1beta1" flowsv1alpha1 "knative.dev/eventing/pkg/apis/flows/v1alpha1" @@ -129,19 +128,6 @@ func (c *Client) CreateSubscriptionsOrFail( } } -func (c *Client) CreateConfigMapPropagationOrFail(name string) *configsv1alpha1.ConfigMapPropagation { - c.T.Logf("Creating configMapPropagation %s", name) - namespace := c.Namespace - configMapPropagation := resources.ConfigMapPropagation(name, namespace) - configMapPropagations := c.Eventing.ConfigsV1alpha1().ConfigMapPropagations(namespace) - configMapPropagation, err := configMapPropagations.Create(configMapPropagation) - if err != nil { - c.T.Fatalf("Failed to create configMapPropagation %q: %v", name, err) - } - c.Tracker.AddObj(configMapPropagation) - return configMapPropagation -} - // CreateConfigMapOrFail will create a configmap or fail the test if there is an error. func (c *Client) CreateConfigMapOrFail(name, namespace string, data map[string]string) *corev1.ConfigMap { c.T.Logf("Creating configmap %s", name) diff --git a/vendor/knative.dev/eventing/test/lib/resources/eventing.go b/vendor/knative.dev/eventing/test/lib/resources/eventing.go index 6d1d24899e..cf35b67a93 100644 --- a/vendor/knative.dev/eventing/test/lib/resources/eventing.go +++ b/vendor/knative.dev/eventing/test/lib/resources/eventing.go @@ -28,13 +28,11 @@ import ( duckv1 "knative.dev/pkg/apis/duck/v1" pkgTest "knative.dev/pkg/test" - configsv1alpha1 "knative.dev/eventing/pkg/apis/configs/v1alpha1" eventingduckv1beta1 "knative.dev/eventing/pkg/apis/duck/v1beta1" eventingv1alpha1 "knative.dev/eventing/pkg/apis/eventing/v1alpha1" eventingv1beta1 "knative.dev/eventing/pkg/apis/eventing/v1beta1" messagingv1alpha1 "knative.dev/eventing/pkg/apis/messaging/v1alpha1" messagingv1beta1 "knative.dev/eventing/pkg/apis/messaging/v1beta1" - "knative.dev/eventing/pkg/reconciler/namespace/resources" ) // BrokerOption enables further configuration of a Broker. @@ -251,30 +249,12 @@ func WithBrokerClassForBroker(brokerClass string) BrokerOption { } } -// ConfigMapPropagation returns a ConfigMapPropagation. -func ConfigMapPropagation(name, namespace string) *configsv1alpha1.ConfigMapPropagation { - return &configsv1alpha1.ConfigMapPropagation{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: namespace, - Name: name, - }, - Spec: configsv1alpha1.ConfigMapPropagationSpec{ - OriginalNamespace: "knative-eventing", - Selector: &metav1.LabelSelector{ - MatchLabels: resources.ConfigMapPropagationOwnedLabels(), - }, - }, - } -} - // ConfigMap returns a ConfigMap. func ConfigMap(name string, data map[string]string) *corev1.ConfigMap { return &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: name, Labels: map[string]string{ - // Filter label for a configmap being picked to be propagated by current configmappropagation. - resources.CmpDefaultLabelKey: resources.CmpDefaultLabelValue, // Default label for a configmap being eligible to be propagated. "knative.dev/config-propagation": "original", }, diff --git a/vendor/knative.dev/pkg/apis/duck/v1/status_types.go b/vendor/knative.dev/pkg/apis/duck/v1/status_types.go index 53006708f6..aab246b1f9 100644 --- a/vendor/knative.dev/pkg/apis/duck/v1/status_types.go +++ b/vendor/knative.dev/pkg/apis/duck/v1/status_types.go @@ -96,7 +96,7 @@ func (source *Status) ConvertTo(ctx context.Context, sink *Status, predicates .. sink.ObservedGeneration = source.ObservedGeneration if source.Annotations != nil { // This will deep copy the map. - sink.Annotations = kmeta.UnionMaps(source.Annotations, nil) + sink.Annotations = kmeta.UnionMaps(source.Annotations) } conditions := make(apis.Conditions, 0, len(source.Conditions)) diff --git a/vendor/knative.dev/pkg/apis/duck/v1beta1/status_types.go b/vendor/knative.dev/pkg/apis/duck/v1beta1/status_types.go index d90e7dc696..107592e85d 100644 --- a/vendor/knative.dev/pkg/apis/duck/v1beta1/status_types.go +++ b/vendor/knative.dev/pkg/apis/duck/v1beta1/status_types.go @@ -109,7 +109,8 @@ func (s *Status) GetCondition(t apis.ConditionType) *apis.Condition { func (source *Status) ConvertTo(ctx context.Context, sink *Status) { sink.ObservedGeneration = source.ObservedGeneration if source.Annotations != nil { - sink.Annotations = kmeta.UnionMaps(source.Annotations, nil) + // This will deep copy the map. + sink.Annotations = kmeta.UnionMaps(source.Annotations) } for _, c := range source.Conditions { switch c.Type { diff --git a/vendor/knative.dev/pkg/configmap/parse.go b/vendor/knative.dev/pkg/configmap/parse.go index 6479598b7e..210d2114ed 100644 --- a/vendor/knative.dev/pkg/configmap/parse.go +++ b/vendor/knative.dev/pkg/configmap/parse.go @@ -22,6 +22,7 @@ import ( "strings" "time" + "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/util/sets" ) @@ -114,6 +115,21 @@ func AsStringSet(key string, target *sets.String) ParseFunc { } } +// AsQuantity parses the value at key as a *resource.Quantity into the target, if it exists +func AsQuantity(key string, target **resource.Quantity) ParseFunc { + return func(data map[string]string) error { + if raw, ok := data[key]; ok { + val, err := resource.ParseQuantity(raw) + if err != nil { + return fmt.Errorf("failed to parse %q: %w", key, err) + } + + *target = &val + } + return nil + } +} + // Parse parses the given map using the parser functions passed in. func Parse(data map[string]string, parsers ...ParseFunc) error { for _, parse := range parsers { diff --git a/vendor/knative.dev/serving/pkg/apis/config/defaults.go b/vendor/knative.dev/serving/pkg/apis/config/defaults.go index a458e71fd3..52918dc92d 100644 --- a/vendor/knative.dev/serving/pkg/apis/config/defaults.go +++ b/vendor/knative.dev/serving/pkg/apis/config/defaults.go @@ -83,10 +83,10 @@ func NewDefaultsConfigFromMap(data map[string]string) (*Defaults, error) { cm.AsInt64("container-concurrency", &nc.ContainerConcurrency), cm.AsInt64("container-concurrency-max-limit", &nc.ContainerConcurrencyMaxLimit), - asQuantity("revision-cpu-request", &nc.RevisionCPURequest), - asQuantity("revision-memory-request", &nc.RevisionMemoryRequest), - asQuantity("revision-cpu-limit", &nc.RevisionCPULimit), - asQuantity("revision-memory-limit", &nc.RevisionMemoryLimit), + cm.AsQuantity("revision-cpu-request", &nc.RevisionCPURequest), + cm.AsQuantity("revision-memory-request", &nc.RevisionMemoryRequest), + cm.AsQuantity("revision-cpu-limit", &nc.RevisionCPULimit), + cm.AsQuantity("revision-memory-limit", &nc.RevisionMemoryLimit), ); err != nil { return nil, err } @@ -155,17 +155,3 @@ func (d *Defaults) UserContainerName(ctx context.Context) string { } return buf.String() } - -// asQuantity parses the value at key as a *resource.Quantity into the target, if it exists. -func asQuantity(key string, target **resource.Quantity) cm.ParseFunc { - return func(data map[string]string) error { - if raw, ok := data[key]; !ok { - *target = nil - } else if val, err := resource.ParseQuantity(raw); err != nil { - return err - } else { - *target = &val - } - return nil - } -} diff --git a/vendor/modules.txt b/vendor/modules.txt index a562febf6a..338228c3dc 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1074,7 +1074,7 @@ k8s.io/utils/buffer k8s.io/utils/integer k8s.io/utils/pointer k8s.io/utils/trace -# knative.dev/eventing v0.15.1-0.20200528004559-c607c293b2a5 +# knative.dev/eventing v0.15.1-0.20200529161002-7b930d1b5057 knative.dev/eventing/pkg/adapter/v2 knative.dev/eventing/pkg/adapter/v2/test knative.dev/eventing/pkg/apis/config @@ -1155,7 +1155,6 @@ knative.dev/eventing/pkg/kncloudevents knative.dev/eventing/pkg/logconfig knative.dev/eventing/pkg/logging knative.dev/eventing/pkg/reconciler/names -knative.dev/eventing/pkg/reconciler/namespace/resources knative.dev/eventing/pkg/reconciler/source knative.dev/eventing/pkg/reconciler/testing knative.dev/eventing/pkg/tracing @@ -1184,7 +1183,7 @@ knative.dev/eventing/test/test_images/recordevents knative.dev/eventing/test/test_images/sendevents knative.dev/eventing/test/test_images/sequencestepper knative.dev/eventing/test/test_images/transformevents -# knative.dev/pkg v0.0.0-20200527173759-2d1a04d1ff82 +# knative.dev/pkg v0.0.0-20200528190300-08a86da47d28 knative.dev/pkg/apis knative.dev/pkg/apis/duck knative.dev/pkg/apis/duck/v1 @@ -1269,7 +1268,7 @@ knative.dev/pkg/webhook/psbinding knative.dev/pkg/webhook/resourcesemantics knative.dev/pkg/webhook/resourcesemantics/defaulting knative.dev/pkg/webhook/resourcesemantics/validation -# knative.dev/serving v0.15.1-0.20200528080059-a1de2b9fa410 +# knative.dev/serving v0.15.1-0.20200529155502-1b878b36836e knative.dev/serving/pkg/apis/autoscaling knative.dev/serving/pkg/apis/autoscaling/v1alpha1 knative.dev/serving/pkg/apis/config @@ -1305,7 +1304,7 @@ knative.dev/serving/pkg/client/listers/networking/v1alpha1 knative.dev/serving/pkg/client/listers/serving/v1 knative.dev/serving/pkg/client/listers/serving/v1alpha1 knative.dev/serving/pkg/client/listers/serving/v1beta1 -# knative.dev/test-infra v0.0.0-20200527191759-5ba38edc41ae +# knative.dev/test-infra v0.0.0-20200528222301-350178ab2a0e knative.dev/test-infra/scripts # sigs.k8s.io/yaml v1.2.0 sigs.k8s.io/yaml