-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User can specify the namespace in yaml for knative-eventing #711
User can specify the namespace in yaml for knative-eventing #711
Conversation
2d1b7e3
to
09bbf3d
Compare
pkg/system/names.go
Outdated
|
||
// Namespace holds the K8s namespace where our eventing system | ||
// components run. | ||
func Namespace() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to move this to some common location (e.g. to https://github.com/knative/pkg)
looks like relevant for serving, build etc as wll
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Serving, building and eventing are all belong to knative. I think we can put the three into one namespace. So that we can use helm chart management easily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to @matzew , so that serving, building and eventing will not need to define this function but just import is enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, it seems like this should be in knative/pkg.
/ok-to-test |
90dae52
to
760c38e
Compare
/test pull-knative-eventing-go-coverage |
1 similar comment
/test pull-knative-eventing-go-coverage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, but I'll wait until it has merged into serving before LGTMing here, so that we can ensure the two implementations are in sync.
6c68d5b
to
fc3eeb5
Compare
/test pull-knative-eventing-go-coverage |
@Harwayne The PR knative/serving#2708 has already merged. Can we merge this PR now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/hold
Holding for reasoning on why knative-testing
is used in unit tests.
pkg/system/testing/names.go
Outdated
) | ||
|
||
func init() { | ||
os.Setenv(system.NamespaceEnvKey, "knative-testing") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not knative-eventing
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we want to put this in knative/pkg
. Then the three component of knative will be use the same namespace. So here we change the namespace knative-testing
to match. The serving
and build
component namespace is also knative-testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the intention to put all knative pieces into a single namespace? Just in tests? Or in production as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope it in production and I'm doing this now. I think some other people also doing this(knative/serving#2623).
pkg/system/names.go
Outdated
|
||
// Namespace holds the K8s namespace where our eventing system | ||
// components run. | ||
func Namespace() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, it seems like this should be in knative/pkg.
4215cd8
to
a4f4cf5
Compare
/hold cancel |
911a070
to
8d0e8d1
Compare
07b83c2
to
bca8c7b
Compare
test/test_images/logevents/main.go
Outdated
@@ -29,7 +28,7 @@ type Heartbeat struct { | |||
|
|||
func handler(ctx context.Context, data map[string]interface{}) { | |||
metadata := cloudevents.FromContext(ctx) | |||
log.Printf("[%s] %s %s: %+v", metadata.EventTime.Format(time.RFC3339), metadata.ContentType, metadata.Source, data) | |||
log.Printf("[%s]: %+v", metadata.DataContentType(), data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found the latest event.go
in knative/pkg
change the function FromContext
return value type from *EventContext
to LoadContext
. So there is no EventTime
, ContentType
and Source
in metadata
. For run this test, I change the log here. I'm not sure if here is right? @evankanderson @mattmoor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to do the following:
metadata := cloudevents.FromContext(ctx).AsV02()
log.Printf("[%s] %s %s: %+v", metadata.Time.Format(time.RFC3339), metadata.ContentType, metadata.Source, data)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
/test pull-knative-eventing-go-coverage |
The following is the coverage report on pkg/.
|
bca8c7b
to
f3cdceb
Compare
f3cdceb
to
3b0c0ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: evankanderson, zxDiscovery The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
value: gcppubsub-channel-key | ||
- name: DEFAULT_SECRET_KEY | ||
value: key.json | ||
env: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops
@@ -175,3 +180,8 @@ spec: | |||
containers: | |||
- name: dispatcher | |||
image: github.com/knative/eventing/contrib/natss/pkg/dispatcher | |||
env: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indenting seems off
@@ -103,6 +103,11 @@ spec: | |||
containers: | |||
- name: controller | |||
image: github.com/knative/eventing/contrib/natss/pkg/controller | |||
env: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indenting seems off
Fixes knative/serving#2623
Proposed Changes
User can set
knative-eventing
deployment namespace in yaml file.The change is similar to knative/serving#2708