From e85e7a8e3293fc0516b960d9954e8815d2983d66 Mon Sep 17 00:00:00 2001 From: Nacho Cano Date: Tue, 15 Oct 2019 22:33:36 -0700 Subject: [PATCH 01/12] updating pkg --- Gopkg.lock | 4 ++-- test/performance/tools/common.sh | 2 +- vendor/knative.dev/pkg/testutils/gke/addon.go | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 6f3a66eaafb..e5e2d8e5534 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1242,7 +1242,7 @@ [[projects]] branch = "master" - digest = "1:65171358e818b1a970f43f886342ef0db6f8cfb2cd4c33b5c5381d846fa64013" + digest = "1:9cbababf809526beba72d5c43e877708afc1f200a697b54dc18507c370f20ea8" name = "knative.dev/pkg" packages = [ "apis", @@ -1331,7 +1331,7 @@ "webhook", ] pruneopts = "T" - revision = "e76e90e464c7caa87abdf840d599911ad1fb7b3e" + revision = "757d7e4c7706e3fc60d72627e8a7250e909a137e" [[projects]] branch = "master" diff --git a/test/performance/tools/common.sh b/test/performance/tools/common.sh index 8aa7890a4cc..5016c07b88a 100644 --- a/test/performance/tools/common.sh +++ b/test/performance/tools/common.sh @@ -52,7 +52,7 @@ function create_cluster() { function create_secret() { echo "Create service account on cluster $1 in zone $2" gcloud container clusters get-credentials $1 --zone=$2 --project=${PROJECT_NAME} || abort "Failed to get cluster creds" - kubectl create secret generic service-account --from-file=robot.json=${PERF_TEST_GOOGLE_APPLICATION_CREDENTIALS} + kubectl create secret generic knative-gcp-mako --from-file=robot.json=${PERF_TEST_GOOGLE_APPLICATION_CREDENTIALS} } # Set up the user credentials for cluster operations. diff --git a/vendor/knative.dev/pkg/testutils/gke/addon.go b/vendor/knative.dev/pkg/testutils/gke/addon.go index 4300fb4daf3..f8f98d0254e 100644 --- a/vendor/knative.dev/pkg/testutils/gke/addon.go +++ b/vendor/knative.dev/pkg/testutils/gke/addon.go @@ -25,20 +25,29 @@ import ( const ( // Define all supported addons here - istio = "istio" + istio = "istio" + hpa = "horizontalpodautoscaling" + hlb = "httploadbalancing" + cloudRun = "cloudrun" ) // GetAddonsConfig gets AddonsConfig from a slice of addon names, contains the logic of // converting string argument to typed AddonsConfig, for example `IstioConfig`. -// Currently supports istio +// Currently supports Istio, HorizontalPodAutoscaling, HttpLoadBalancing and CloudRun. func GetAddonsConfig(addons []string) *container.AddonsConfig { ac := &container.AddonsConfig{} for _, name := range addons { switch strings.ToLower(name) { case istio: ac.IstioConfig = &container.IstioConfig{Disabled: false} + case hpa: + ac.HorizontalPodAutoscaling = &container.HorizontalPodAutoscaling{Disabled: false} + case hlb: + ac.HttpLoadBalancing = &container.HttpLoadBalancing{Disabled: false} + case cloudRun: + ac.CloudRunConfig = &container.CloudRunConfig{Disabled: false} default: - panic(fmt.Sprintf("addon type %q not supported. Has to be one of: %q", name, istio)) + panic(fmt.Sprintf("addon type %q not supported. Has to be one of: %q", name, []string{istio, hpa, hlb, cloudRun})) } } From b55b2cc653b76273798e0d9f1b140be39c386078 Mon Sep 17 00:00:00 2001 From: Nacho Cano Date: Tue, 15 Oct 2019 23:03:14 -0700 Subject: [PATCH 02/12] Revert "updating pkg" This reverts commit e85e7a8e3293fc0516b960d9954e8815d2983d66. --- Gopkg.lock | 4 ++-- test/performance/tools/common.sh | 2 +- vendor/knative.dev/pkg/testutils/gke/addon.go | 15 +++------------ 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index e5e2d8e5534..6f3a66eaafb 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1242,7 +1242,7 @@ [[projects]] branch = "master" - digest = "1:9cbababf809526beba72d5c43e877708afc1f200a697b54dc18507c370f20ea8" + digest = "1:65171358e818b1a970f43f886342ef0db6f8cfb2cd4c33b5c5381d846fa64013" name = "knative.dev/pkg" packages = [ "apis", @@ -1331,7 +1331,7 @@ "webhook", ] pruneopts = "T" - revision = "757d7e4c7706e3fc60d72627e8a7250e909a137e" + revision = "e76e90e464c7caa87abdf840d599911ad1fb7b3e" [[projects]] branch = "master" diff --git a/test/performance/tools/common.sh b/test/performance/tools/common.sh index 5016c07b88a..8aa7890a4cc 100644 --- a/test/performance/tools/common.sh +++ b/test/performance/tools/common.sh @@ -52,7 +52,7 @@ function create_cluster() { function create_secret() { echo "Create service account on cluster $1 in zone $2" gcloud container clusters get-credentials $1 --zone=$2 --project=${PROJECT_NAME} || abort "Failed to get cluster creds" - kubectl create secret generic knative-gcp-mako --from-file=robot.json=${PERF_TEST_GOOGLE_APPLICATION_CREDENTIALS} + kubectl create secret generic service-account --from-file=robot.json=${PERF_TEST_GOOGLE_APPLICATION_CREDENTIALS} } # Set up the user credentials for cluster operations. diff --git a/vendor/knative.dev/pkg/testutils/gke/addon.go b/vendor/knative.dev/pkg/testutils/gke/addon.go index f8f98d0254e..4300fb4daf3 100644 --- a/vendor/knative.dev/pkg/testutils/gke/addon.go +++ b/vendor/knative.dev/pkg/testutils/gke/addon.go @@ -25,29 +25,20 @@ import ( const ( // Define all supported addons here - istio = "istio" - hpa = "horizontalpodautoscaling" - hlb = "httploadbalancing" - cloudRun = "cloudrun" + istio = "istio" ) // GetAddonsConfig gets AddonsConfig from a slice of addon names, contains the logic of // converting string argument to typed AddonsConfig, for example `IstioConfig`. -// Currently supports Istio, HorizontalPodAutoscaling, HttpLoadBalancing and CloudRun. +// Currently supports istio func GetAddonsConfig(addons []string) *container.AddonsConfig { ac := &container.AddonsConfig{} for _, name := range addons { switch strings.ToLower(name) { case istio: ac.IstioConfig = &container.IstioConfig{Disabled: false} - case hpa: - ac.HorizontalPodAutoscaling = &container.HorizontalPodAutoscaling{Disabled: false} - case hlb: - ac.HttpLoadBalancing = &container.HttpLoadBalancing{Disabled: false} - case cloudRun: - ac.CloudRunConfig = &container.CloudRunConfig{Disabled: false} default: - panic(fmt.Sprintf("addon type %q not supported. Has to be one of: %q", name, []string{istio, hpa, hlb, cloudRun})) + panic(fmt.Sprintf("addon type %q not supported. Has to be one of: %q", name, istio)) } } From bb94aa5e048efa7356eca6697c28bca0d911507b Mon Sep 17 00:00:00 2001 From: Nacho Cano Date: Wed, 23 Oct 2019 22:06:55 -0700 Subject: [PATCH 03/12] adding registry stuff --- docs/spec/sources.md | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/docs/spec/sources.md b/docs/spec/sources.md index f64311e6e78..49d1a31ce45 100644 --- a/docs/spec/sources.md +++ b/docs/spec/sources.md @@ -35,7 +35,7 @@ For operators of a Kubernetes cluster, there are two states to sources: find and discover what is possible to source events from. This topic is expanded upon in the [Source CRDs](#source-crds) section. -1. A Source custom object has been created in the cluster. +1. A Source Custom Object (CO) has been created in the cluster. Once a developer creates an instance of a source and provides the necessary parameters, the source controller will realize this into whatever is required @@ -185,9 +185,32 @@ validation: on the event as an extension attribute independently." ``` - +### Source Registry -## Source RBAC +Source CRDs SHOULD use a standard annotation to expose the types of events they can +emit in order to ease discoverability. + +```yaml +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + annotations: + registry.knative.dev/eventTypes: | # <-- optional but encouraged. + [ + { "type": "foo", "schema": "foo-schema", "description" : "Foo event description" }, + { "type": "bar", "schema": "bar-schema", "description" : "Bar event description" }, + ... + ] +``` + +If specified, the annotation SHOULD be a valid JSON array so that it can be easily unmarshalled by tooling +(e.g., a CLI). In particular, each object in the array SHOULD contain the following fields: + +- type: Refers to the [CloudEvents type](https://github.com/cloudevents/spec/blob/v1.0-rc1/spec.md#type) attribute. Mandatory. +- schema: Refers to the [CloudEvents dataschema](https://github.com/cloudevents/spec/blob/v1.0-rc1/spec.md#dataschema) attribute. Optional. +- description: String describing the event. Optional. + +### Source RBAC Sources are expected to be extensions onto Kubernetes. To prevent cluster operators from duplicating RBAC for all accounts that will interact with @@ -237,7 +260,7 @@ rules: ## Source Custom Objects -All Source custom objects MUST implement the +All Source Custom Objects MUST implement the [Source](https://godoc.org/github.com/knative/pkg/apis/duck/v1#Source) ducktype. Additional data in spec and status is explicitly permitted. @@ -286,3 +309,11 @@ type SourceStatus struct { For a full definition of `Status` and `SinkURI`, please see [Status](https://godoc.org/github.com/knative/pkg/apis/duck/v1#Status), and [URL](https://godoc.org/knative.dev/pkg/apis#URL). + +### EventType Registry + +Upon instantiation of a Source Custom Object, the source controller SHOULD realize +the [EventType(s)](https://godoc.org/knative.dev/eventing/pkg/apis/eventing/v1alpha1#EventType) +this instantiation brings onto the eventing mesh. +For a more detailed description, please refer to the +[Event Registry](https://knative.dev/docs/eventing/event-registry/) documentation. From 4a0cac28e6c73f6b072fd1575955c06e0d6bfc6d Mon Sep 17 00:00:00 2001 From: Nacho Cano Date: Wed, 23 Oct 2019 22:09:50 -0700 Subject: [PATCH 04/12] event types --- docs/spec/sources.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/spec/sources.md b/docs/spec/sources.md index 49d1a31ce45..2fce8cda37a 100644 --- a/docs/spec/sources.md +++ b/docs/spec/sources.md @@ -312,7 +312,8 @@ For a full definition of `Status` and `SinkURI`, please see ### EventType Registry -Upon instantiation of a Source Custom Object, the source controller SHOULD realize +Upon instantiation of a Source Custom Object, a controller (potentially the source +controller) SHOULD realize the [EventType(s)](https://godoc.org/knative.dev/eventing/pkg/apis/eventing/v1alpha1#EventType) this instantiation brings onto the eventing mesh. For a more detailed description, please refer to the From e2ce2a68b1a559d1c5a5773e3f1df9690db0d0d3 Mon Sep 17 00:00:00 2001 From: "Ignacio (Nacho) Cano" Date: Wed, 23 Oct 2019 22:11:13 -0700 Subject: [PATCH 05/12] Update docs/spec/sources.md Co-Authored-By: mattmoor-sockpuppet --- docs/spec/sources.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/sources.md b/docs/spec/sources.md index 2fce8cda37a..1b5be2920ce 100644 --- a/docs/spec/sources.md +++ b/docs/spec/sources.md @@ -203,7 +203,7 @@ metadata: ] ``` -If specified, the annotation SHOULD be a valid JSON array so that it can be easily unmarshalled by tooling +If specified, the annotation SHOULD be a valid JSON array so that it can be easily unmarshalled by tooling (e.g., a CLI). In particular, each object in the array SHOULD contain the following fields: - type: Refers to the [CloudEvents type](https://github.com/cloudevents/spec/blob/v1.0-rc1/spec.md#type) attribute. Mandatory. From 0f79e73ca975c0f6fdc2865fc12e582b02a186ee Mon Sep 17 00:00:00 2001 From: "Ignacio (Nacho) Cano" Date: Wed, 23 Oct 2019 22:11:33 -0700 Subject: [PATCH 06/12] Update docs/spec/sources.md Co-Authored-By: mattmoor-sockpuppet --- docs/spec/sources.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/spec/sources.md b/docs/spec/sources.md index 1b5be2920ce..73a20401053 100644 --- a/docs/spec/sources.md +++ b/docs/spec/sources.md @@ -209,7 +209,6 @@ If specified, the annotation SHOULD be a valid JSON array so that it can be easi - type: Refers to the [CloudEvents type](https://github.com/cloudevents/spec/blob/v1.0-rc1/spec.md#type) attribute. Mandatory. - schema: Refers to the [CloudEvents dataschema](https://github.com/cloudevents/spec/blob/v1.0-rc1/spec.md#dataschema) attribute. Optional. - description: String describing the event. Optional. - ### Source RBAC Sources are expected to be extensions onto Kubernetes. To prevent cluster From 82797f28a6430f0097516a070b6ff8f208f42586 Mon Sep 17 00:00:00 2001 From: "Ignacio (Nacho) Cano" Date: Wed, 23 Oct 2019 22:11:52 -0700 Subject: [PATCH 07/12] Update docs/spec/sources.md Co-Authored-By: mattmoor-sockpuppet --- docs/spec/sources.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/sources.md b/docs/spec/sources.md index 73a20401053..68b007ba03a 100644 --- a/docs/spec/sources.md +++ b/docs/spec/sources.md @@ -311,7 +311,7 @@ For a full definition of `Status` and `SinkURI`, please see ### EventType Registry -Upon instantiation of a Source Custom Object, a controller (potentially the source +Upon instantiation of a Source Custom Object, a controller (potentially the source controller) SHOULD realize the [EventType(s)](https://godoc.org/knative.dev/eventing/pkg/apis/eventing/v1alpha1#EventType) this instantiation brings onto the eventing mesh. From 7df1694373287dfb7cc47df9f1729b1f811a8abb Mon Sep 17 00:00:00 2001 From: "Ignacio (Nacho) Cano" Date: Wed, 23 Oct 2019 22:12:08 -0700 Subject: [PATCH 08/12] Update docs/spec/sources.md Co-Authored-By: mattmoor-sockpuppet --- docs/spec/sources.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/sources.md b/docs/spec/sources.md index 68b007ba03a..cd6b3e7dfd0 100644 --- a/docs/spec/sources.md +++ b/docs/spec/sources.md @@ -312,7 +312,7 @@ For a full definition of `Status` and `SinkURI`, please see ### EventType Registry Upon instantiation of a Source Custom Object, a controller (potentially the source -controller) SHOULD realize +controller) SHOULD realize the [EventType(s)](https://godoc.org/knative.dev/eventing/pkg/apis/eventing/v1alpha1#EventType) this instantiation brings onto the eventing mesh. For a more detailed description, please refer to the From f3e2c3be9dd61932e2ee6faf476bafc2ff3ae4cb Mon Sep 17 00:00:00 2001 From: "Ignacio (Nacho) Cano" Date: Wed, 23 Oct 2019 22:12:23 -0700 Subject: [PATCH 09/12] Update docs/spec/sources.md Co-Authored-By: mattmoor-sockpuppet --- docs/spec/sources.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/sources.md b/docs/spec/sources.md index cd6b3e7dfd0..49cccd95e6d 100644 --- a/docs/spec/sources.md +++ b/docs/spec/sources.md @@ -314,6 +314,6 @@ For a full definition of `Status` and `SinkURI`, please see Upon instantiation of a Source Custom Object, a controller (potentially the source controller) SHOULD realize the [EventType(s)](https://godoc.org/knative.dev/eventing/pkg/apis/eventing/v1alpha1#EventType) -this instantiation brings onto the eventing mesh. +this instantiation brings onto the eventing mesh. For a more detailed description, please refer to the [Event Registry](https://knative.dev/docs/eventing/event-registry/) documentation. From 94d1a9aa8657498c984e4a2c2f35022e1823a480 Mon Sep 17 00:00:00 2001 From: "Ignacio (Nacho) Cano" Date: Wed, 23 Oct 2019 22:12:42 -0700 Subject: [PATCH 10/12] Update docs/spec/sources.md Co-Authored-By: mattmoor-sockpuppet --- docs/spec/sources.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/sources.md b/docs/spec/sources.md index 49cccd95e6d..07fd47ed138 100644 --- a/docs/spec/sources.md +++ b/docs/spec/sources.md @@ -315,5 +315,5 @@ Upon instantiation of a Source Custom Object, a controller (potentially the sour controller) SHOULD realize the [EventType(s)](https://godoc.org/knative.dev/eventing/pkg/apis/eventing/v1alpha1#EventType) this instantiation brings onto the eventing mesh. -For a more detailed description, please refer to the +For a more detailed description, please refer to the [Event Registry](https://knative.dev/docs/eventing/event-registry/) documentation. From 982e105743a3d924b4d62ff8232b1acd3a98c93a Mon Sep 17 00:00:00 2001 From: "Ignacio (Nacho) Cano" Date: Wed, 23 Oct 2019 22:12:59 -0700 Subject: [PATCH 11/12] Update docs/spec/sources.md Co-Authored-By: mattmoor-sockpuppet --- docs/spec/sources.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/sources.md b/docs/spec/sources.md index 07fd47ed138..84db5fa10f0 100644 --- a/docs/spec/sources.md +++ b/docs/spec/sources.md @@ -316,4 +316,4 @@ controller) SHOULD realize the [EventType(s)](https://godoc.org/knative.dev/eventing/pkg/apis/eventing/v1alpha1#EventType) this instantiation brings onto the eventing mesh. For a more detailed description, please refer to the -[Event Registry](https://knative.dev/docs/eventing/event-registry/) documentation. +[Event Registry](https://knative.dev/docs/eventing/event-registry/) documentation. From b75fa42b16b927b8fea5b79eb275839ff0cd1c06 Mon Sep 17 00:00:00 2001 From: nachocano Date: Thu, 24 Oct 2019 09:29:58 -0700 Subject: [PATCH 12/12] updates --- docs/spec/sources.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/spec/sources.md b/docs/spec/sources.md index 84db5fa10f0..3f01afd856d 100644 --- a/docs/spec/sources.md +++ b/docs/spec/sources.md @@ -203,12 +203,13 @@ metadata: ] ``` -If specified, the annotation SHOULD be a valid JSON array so that it can be easily unmarshalled by tooling -(e.g., a CLI). In particular, each object in the array SHOULD contain the following fields: +If specified, the annotation MUST be a valid JSON array so that it can be easily unmarshalled by tooling +(e.g., a CLI). In particular, each object in the array MUST contain the following fields: -- type: Refers to the [CloudEvents type](https://github.com/cloudevents/spec/blob/v1.0-rc1/spec.md#type) attribute. Mandatory. -- schema: Refers to the [CloudEvents dataschema](https://github.com/cloudevents/spec/blob/v1.0-rc1/spec.md#dataschema) attribute. Optional. +- type: String. Refers to the [CloudEvents type](https://github.com/cloudevents/spec/blob/v1.0-rc1/spec.md#type) attribute. Mandatory. +- schema: String. Refers to the [CloudEvents dataschema](https://github.com/cloudevents/spec/blob/v1.0-rc1/spec.md#dataschema) attribute. Optional. - description: String describing the event. Optional. + ### Source RBAC Sources are expected to be extensions onto Kubernetes. To prevent cluster