Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

Commit

Permalink
[master] Auto-update dependencies (#1259)
Browse files Browse the repository at this point in the history
Produced via:
  `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh`
/assign grantr lberk n3wscott
/cc grantr lberk n3wscott
  • Loading branch information
mattmoor authored May 22, 2020
1 parent 6eb3696 commit 5f84699
Show file tree
Hide file tree
Showing 22 changed files with 133 additions and 107 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ require (
k8s.io/api v0.17.4
k8s.io/apimachinery v0.17.4
k8s.io/client-go v12.0.0+incompatible
knative.dev/eventing v0.14.1-0.20200520123858-f378da1aafe5
knative.dev/eventing v0.14.1-0.20200522004258-12c1ec1d407b
knative.dev/pkg v0.0.0-20200519155757-14eb3ae3a5a7
knative.dev/serving v0.14.1-0.20200520101257-064e8097fb0f
knative.dev/serving v0.14.1-0.20200522094558-1a37ebcb13f8
knative.dev/test-infra v0.0.0-20200519161858-554a95a37986
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1531,8 +1531,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-20200519161457-43a93f35737e/go.mod h1:MX8oysHHDn6GTy+WWIgR80p78RIHV5p14xsXvrqvkbw=
knative.dev/eventing v0.14.1-0.20200520123858-f378da1aafe5 h1:fS0NLwtgYh2gU9RI5EpJ4P75mRGrkYJ9p7UbW+YK+48=
knative.dev/eventing v0.14.1-0.20200520123858-f378da1aafe5/go.mod h1:J6FnmHXZaB3g2TmP2QkzUCuiysahAEHAdvpWx2gRh0o=
knative.dev/eventing v0.14.1-0.20200522004258-12c1ec1d407b h1:7/QwUtkzjhKDGC24PeLwIH7GvEPsuy0187s/ydIc4mM=
knative.dev/eventing v0.14.1-0.20200522004258-12c1ec1d407b/go.mod h1:J6FnmHXZaB3g2TmP2QkzUCuiysahAEHAdvpWx2gRh0o=
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=
Expand All @@ -1544,8 +1544,8 @@ knative.dev/pkg v0.0.0-20200515002500-16d7b963416f/go.mod h1:tMOHGbxtRz8zYFGEGpV
knative.dev/pkg v0.0.0-20200518174206-60f4ae1dbe6f/go.mod h1:GinFtW8LEi9rzCkzCMHAIlAnZjP1RzauxwhRAI3rimI=
knative.dev/pkg v0.0.0-20200519155757-14eb3ae3a5a7 h1:9S2r59HZJF9nKvoRLg5zJzx6XpVlVyvVRqz/C/h6h2s=
knative.dev/pkg v0.0.0-20200519155757-14eb3ae3a5a7/go.mod h1:QgNZTxnwpB/oSpNcfnLVlw+WpEwwyKAvJlvR3hgeltA=
knative.dev/serving v0.14.1-0.20200520101257-064e8097fb0f h1:K+e3SsyEZfIoFwaXeC/b09b6pI6b7zR9zEajzNX69cM=
knative.dev/serving v0.14.1-0.20200520101257-064e8097fb0f/go.mod h1:jGOPiYDiIwQQJ8XqMe70iFdCf3kfJ4NTD8jUBBWw4xo=
knative.dev/serving v0.14.1-0.20200522094558-1a37ebcb13f8 h1:vWlfH7OOiEhgl9xnx9Y7DnpOkii+uQA47wXnNjiboaY=
knative.dev/serving v0.14.1-0.20200522094558-1a37ebcb13f8/go.mod h1:jGOPiYDiIwQQJ8XqMe70iFdCf3kfJ4NTD8jUBBWw4xo=
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=
Expand Down
4 changes: 2 additions & 2 deletions vendor/knative.dev/eventing/pkg/apis/config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
)

const (
// DefaultConfigName is the name of config map for the default
// DefaultsConfigName is the name of config map for the default
// configs that brokers should use
DefaultsConfigName = "config-br-defaults"

Expand Down Expand Up @@ -58,7 +58,7 @@ func parseEntry(entry string, out interface{}) error {
if err != nil {
return fmt.Errorf("ConfigMap's value could not be converted to JSON: %s : %v", err, entry)
}
return json.Unmarshal([]byte(j), &out)
return json.Unmarshal(j, &out)
}

// NewDefaultsConfigFromConfigMap creates a Defaults from the supplied configMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
ChannelDefaulterKey = "default-ch-config"
)

// NewDefaultsConfigFromMap creates a Defaults from the supplied Map
// NewChannelDefaultsConfigFromMap creates a Defaults from the supplied Map
func NewChannelDefaultsConfigFromMap(data map[string]string) (*ChannelDefaults, error) {
nc := &ChannelDefaults{}

Expand All @@ -55,7 +55,7 @@ func parseEntry(entry string, out interface{}) error {
if err != nil {
return fmt.Errorf("ConfigMap's value could not be converted to JSON: %s : %v", err, entry)
}
return json.Unmarshal([]byte(j), &out)
return json.Unmarshal(j, &out)
}

// NewChannelDefaultsConfigFromConfigMap creates a ChannelDefaults from the supplied configMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ func (sink *ChannelStatus) ConvertFrom(ctx context.Context, source v1beta1.Chann
sink.SubscribableTypeStatus.SubscribableStatus = &duckv1alpha1.SubscribableStatus{
Subscribers: make([]duckv1beta1.SubscriberStatus, len(source.SubscribableStatus.Subscribers)),
}
for i, ss := range source.SubscribableStatus.Subscribers {
sink.SubscribableTypeStatus.SubscribableStatus.Subscribers[i] = ss
}
copy(sink.SubscribableTypeStatus.SubscribableStatus.Subscribers, source.SubscribableStatus.Subscribers)
}
if source.Channel != nil {
sink.Channel = &corev1.ObjectReference{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ func (sink *InMemoryChannelStatus) ConvertFrom(ctx context.Context, source v1bet
sink.SubscribableTypeStatus.SubscribableStatus = &duckv1alpha1.SubscribableStatus{
Subscribers: make([]duckv1beta1.SubscriberStatus, len(source.SubscribableStatus.Subscribers)),
}
for i, ss := range source.SubscribableStatus.Subscribers {
sink.SubscribableTypeStatus.SubscribableStatus.Subscribers[i] = ss
}
copy(sink.SubscribableTypeStatus.SubscribableStatus.Subscribers, source.SubscribableStatus.Subscribers)
}
return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,26 @@ limitations under the License.

package v1alpha1

import "context"
import (
"context"

"knative.dev/eventing/pkg/apis/messaging"
)

func (imc *InMemoryChannel) SetDefaults(ctx context.Context) {
imc.Spec.SetDefaults(ctx)

// Set the duck subscription to the stored version of the duck
// we support. Reason for this is that the stored version will
// not get a chance to get modified, but for newer versions
// conversion webhook will be able to take a crack at it and
// can modify it to match the duck shape.
if imc.Annotations == nil {
imc.Annotations = make(map[string]string)
}
if _, ok := imc.Annotations[messaging.SubscribableDuckVersionAnnotation]; !ok {
imc.Annotations[messaging.SubscribableDuckVersionAnnotation] = "v1beta1"
}
}

func (imcs *InMemoryChannelSpec) SetDefaults(ctx context.Context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (imc *InMemoryChannel) SetDefaults(ctx context.Context) {
imc.Annotations = make(map[string]string)
}
if _, ok := imc.Annotations[messaging.SubscribableDuckVersionAnnotation]; !ok {
imc.Annotations[messaging.SubscribableDuckVersionAnnotation] = "v1alpha1"
imc.Annotations[messaging.SubscribableDuckVersionAnnotation] = "v1beta1"
}

imc.Spec.SetDefaults(ctx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ import (

const (
defaultTimeout = 15 * time.Minute

eventBufferSize = 500
)

// Config for a fanout.MessageHandler.
Expand All @@ -51,7 +49,7 @@ type Config struct {
AsyncHandler bool `json:"asyncHandler,omitempty"`
}

// Handler is a http.Handler that takes a single request in and fans it out to N other servers.
// MessageHandler is a http.Handler that takes a single request in and fans it out to N other servers.
type MessageHandler struct {
config Config

Expand All @@ -65,7 +63,7 @@ type MessageHandler struct {
logger *zap.Logger
}

// NewHandler creates a new fanout.MessageHandler.
// NewMessageHandler creates a new fanout.MessageHandler.
func NewMessageHandler(logger *zap.Logger, messageDispatcher channel.MessageDispatcher, config Config) (*MessageHandler, error) {
handler := &MessageHandler{
logger: logger,
Expand Down
18 changes: 18 additions & 0 deletions vendor/knative.dev/eventing/pkg/reconciler/testing/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,24 @@ func WithBrokerReady(b *v1alpha1.Broker) {
b.Status = *v1alpha1.TestHelper.ReadyBrokerStatus()
}

func WithDeprecatedStatus(b *v1alpha1.Broker) {
dc := apis.Condition{
Type: "Deprecated",
Reason: "SingleTenantChannelBrokerDeprecated",
Status: corev1.ConditionTrue,
Severity: apis.ConditionSeverityWarning,
Message: "Single Tenant Channel Brokers are deprecated and will be removed in release 0.16. Use Multi Tenant Channel Brokers instead.",
}

for i, c := range b.Status.Status.Conditions {
if c.Type == dc.Type {
b.Status.Status.Conditions[i] = dc
return
}
}
b.Status.Status.Conditions = append(b.Status.Status.Conditions, dc)
}

// WithTriggerChannelFailed calls .Status.MarkTriggerChannelFailed on the Broker.
func WithTriggerChannelFailed(reason, msg string) BrokerOption {
return func(b *v1alpha1.Broker) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func SingleEventHelperForChannelTestHelper(t *testing.T, encoding string,
client.WaitForAllTestResourcesReadyOrFail()

// send fake CloudEvent to the channel
eventID := fmt.Sprintf("%s", uuid.NewUUID())
eventID := string(uuid.NewUUID())
body := fmt.Sprintf("TestSingleHeaderEvent %s", eventID)
event := cloudevents.New(
fmt.Sprintf(`{"msg":%q}`, body),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func GetTraceTree(trace []model.SpanModel) (*SpanTree, error) {
}

func getChildren(parents map[model.ID][]model.SpanModel, current []model.SpanModel) ([]SpanTree, error) {
var children []SpanTree
children := make([]SpanTree, 0, len(current))
for _, span := range current {
grandchildren, err := getChildren(parents, parents[span.ID])
if err != nil {
Expand Down
22 changes: 0 additions & 22 deletions vendor/knative.dev/eventing/test/conformance/helpers/uri.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,8 @@ package helpers

import (
"fmt"

"knative.dev/eventing/pkg/apis/eventing/v1alpha1"
)

func brokerIngressHost(domain string, broker v1alpha1.Broker) string {
return fmt.Sprintf("%s-broker.%s.svc.%s", broker.Name, broker.Namespace, domain)
}

func channelHost(domain, namespace, chanName string) string {
return fmt.Sprintf("%s-kn-channel.%s.svc.%s", chanName, namespace, domain)
}

func brokerTriggerChannelHost(domain string, broker v1alpha1.Broker) string {
return channelHost(domain, broker.Namespace, fmt.Sprintf("%s-kne-trigger", broker.Name))
}

func brokerFilterHost(domain string, broker v1alpha1.Broker) string {
return fmt.Sprintf("%s-broker-filter.%s.svc.%s", broker.Name, broker.Namespace, domain)
}

func triggerPath(trigger v1alpha1.Trigger) string {
return fmt.Sprintf("/triggers/%s/%s/%s", trigger.Namespace, trigger.Name, trigger.UID)
}

func k8sServiceHost(domain, namespace, svcName string) string {
return fmt.Sprintf("%s.%s.svc.%s", svcName, namespace, domain)
}
49 changes: 20 additions & 29 deletions vendor/knative.dev/eventing/test/e2e/helpers/broker_test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@ import (
"knative.dev/eventing/pkg/apis/eventing"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/uuid"
"knative.dev/eventing/pkg/apis/eventing/v1alpha1"
"knative.dev/eventing/test/lib"
"knative.dev/eventing/test/lib/cloudevents"
"knative.dev/eventing/test/lib/resources"
)

const (
selectorKey = "end2end-test-broker-trigger"

any = v1alpha1.TriggerAnyFilter
eventType1 = "type1"
eventType2 = "type2"
Expand All @@ -60,8 +57,7 @@ type eventContext struct {
// Helper struct to tie the type and sources of the events we expect to receive
// in subscribers with the selectors we use when creating their pods.
type eventReceiver struct {
context eventContext
selector map[string]string
context eventContext
}

// BrokerCreator creates a broker and returns its broker name.
Expand Down Expand Up @@ -112,10 +108,10 @@ func TestBrokerWithManyTriggers(t *testing.T, brokerCreator BrokerCreator, shoul
{
name: "test default broker with many deprecated triggers",
eventsToReceive: []eventReceiver{
{eventContext{Type: any, Source: any}, newSelector()},
{eventContext{Type: eventType1, Source: any}, newSelector()},
{eventContext{Type: any, Source: eventSource1}, newSelector()},
{eventContext{Type: eventType1, Source: eventSource1}, newSelector()},
{eventContext{Type: any, Source: any}},
{eventContext{Type: eventType1, Source: any}},
{eventContext{Type: any, Source: eventSource1}},
{eventContext{Type: eventType1, Source: eventSource1}},
},
eventsToSend: []eventContext{
{Type: eventType1, Source: eventSource1},
Expand All @@ -127,10 +123,10 @@ func TestBrokerWithManyTriggers(t *testing.T, brokerCreator BrokerCreator, shoul
}, {
name: "test default broker with many attribute triggers",
eventsToReceive: []eventReceiver{
{eventContext{Type: any, Source: any}, newSelector()},
{eventContext{Type: eventType1, Source: any}, newSelector()},
{eventContext{Type: any, Source: eventSource1}, newSelector()},
{eventContext{Type: eventType1, Source: eventSource1}, newSelector()},
{eventContext{Type: any, Source: any}},
{eventContext{Type: eventType1, Source: any}},
{eventContext{Type: any, Source: eventSource1}},
{eventContext{Type: eventType1, Source: eventSource1}},
},
eventsToSend: []eventContext{
{Type: eventType1, Source: eventSource1},
Expand All @@ -142,10 +138,10 @@ func TestBrokerWithManyTriggers(t *testing.T, brokerCreator BrokerCreator, shoul
}, {
name: "test default broker with many attribute triggers using v1beta1 trigger",
eventsToReceive: []eventReceiver{
{eventContext{Type: any, Source: any}, newSelector()},
{eventContext{Type: eventType1, Source: any}, newSelector()},
{eventContext{Type: any, Source: eventSource1}, newSelector()},
{eventContext{Type: eventType1, Source: eventSource1}, newSelector()},
{eventContext{Type: any, Source: any}},
{eventContext{Type: eventType1, Source: any}},
{eventContext{Type: any, Source: eventSource1}},
{eventContext{Type: eventType1, Source: eventSource1}},
},
eventsToSend: []eventContext{
{Type: eventType1, Source: eventSource1},
Expand All @@ -158,13 +154,13 @@ func TestBrokerWithManyTriggers(t *testing.T, brokerCreator BrokerCreator, shoul
}, {
name: "test default broker with many attribute and extension triggers",
eventsToReceive: []eventReceiver{
{eventContext{Type: any, Source: any, Extensions: map[string]interface{}{extensionName1: extensionValue1}}, newSelector()},
{eventContext{Type: any, Source: any, Extensions: map[string]interface{}{extensionName1: extensionValue1, extensionName2: extensionValue2}}, newSelector()},
{eventContext{Type: any, Source: any, Extensions: map[string]interface{}{extensionName2: extensionValue2}}, newSelector()},
{eventContext{Type: eventType1, Source: any, Extensions: map[string]interface{}{extensionName1: extensionValue1}}, newSelector()},
{eventContext{Type: any, Source: any, Extensions: map[string]interface{}{extensionName1: any}}, newSelector()},
{eventContext{Type: any, Source: eventSource1, Extensions: map[string]interface{}{extensionName1: extensionValue1}}, newSelector()},
{eventContext{Type: any, Source: eventSource1, Extensions: map[string]interface{}{extensionName1: extensionValue1, extensionName2: extensionValue2}}, newSelector()},
{eventContext{Type: any, Source: any, Extensions: map[string]interface{}{extensionName1: extensionValue1}}},
{eventContext{Type: any, Source: any, Extensions: map[string]interface{}{extensionName1: extensionValue1, extensionName2: extensionValue2}}},
{eventContext{Type: any, Source: any, Extensions: map[string]interface{}{extensionName2: extensionValue2}}},
{eventContext{Type: eventType1, Source: any, Extensions: map[string]interface{}{extensionName1: extensionValue1}}},
{eventContext{Type: any, Source: any, Extensions: map[string]interface{}{extensionName1: any}}},
{eventContext{Type: any, Source: eventSource1, Extensions: map[string]interface{}{extensionName1: extensionValue1}}},
{eventContext{Type: any, Source: eventSource1, Extensions: map[string]interface{}{extensionName1: extensionValue1, extensionName2: extensionValue2}}},
},
eventsToSend: []eventContext{
{Type: eventType1, Source: eventSource1, Extensions: map[string]interface{}{extensionName1: extensionValue1}},
Expand Down Expand Up @@ -332,11 +328,6 @@ func sortedKeys(m map[string]interface{}) []string {
return keys
}

// Returns a new selector with a random uuid.
func newSelector() map[string]string {
return map[string]string{selectorKey: string(uuid.NewUUID())}
}

// Checks whether we should expect to receive 'eventToSend' in 'eventReceiver' based on its type and source pattern.
func shouldExpectEvent(eventToSend *eventContext, receiver *eventReceiver) bool {
if receiver.context.Type != any && receiver.context.Type != eventToSend.Type {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ func updateDefaultChannelCM(client *lib.Client, updateConfig func(config *config
// update the defaultchannel configmap
configMap.Data[channelDefaulterKey] = string(configBytes)
_, err = cmInterface.Update(configMap)
if err != nil {
return err
}
// In cmd/webhook.go, configMapWatcher watches the configmap changes and set the config for channeldefaulter,
// the resync time is set to 0, which means the the resync will be delayed as long as possible (until the upstream
// source closes the watch or times out, or you stop the controller)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ import (
"knative.dev/eventing/test/lib/resources"
)

const (
brokerName = "notdefaultbroker"
)

// TestTriggerNoBroker will create a Trigger with a non-existent broker, then it will ensure
// the Status is correctly reflected as failed with BrokerDoesNotExist. Then it will create
// the broker and ensure that Trigger / Broker will get to Ready state.
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/eventing/test/lib/creation.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (c *Client) CreateBrokerConfigMapOrFail(name string, channel *metav1.TypeMe
`, channel.APIVersion, channel.Kind),
},
}
cm, err := c.Kube.Kube.CoreV1().ConfigMaps(c.Namespace).Create(cm)
_, err := c.Kube.Kube.CoreV1().ConfigMaps(c.Namespace).Create(cm)
if err != nil {
c.T.Fatalf("Failed to create broker config %q: %v", name, err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,8 @@ func (r *Receiver) processEvents() {
return
}
r.receivedEvents.Events[e.EventId] = e.At
case _, _ = <-r.endCh:
case <-r.endCh:
return
default:
}
}
}
Expand Down Expand Up @@ -182,11 +181,9 @@ func waitForPortAvailable(port string) {
var free bool
for i := 0; i < 30; i++ {
conn, err := net.Dial("tcp", ":"+port)
if err != nil {
if _, ok := err.(*net.OpError); ok {
free = true
break
}
if _, ok := err.(*net.OpError); ok {
free = true
break
}
_ = conn.Close()
time.Sleep(10 * time.Millisecond)
Expand Down
Loading

0 comments on commit 5f84699

Please sign in to comment.