Skip to content
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

Merged
merged 6 commits into from
Feb 14, 2019

Conversation

zxDiscovery
Copy link

@zxDiscovery zxDiscovery commented Jan 10, 2019

Fixes knative/serving#2623

Proposed Changes

User can set knative-eventing deployment namespace in yaml file.
The change is similar to knative/serving#2708

@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 10, 2019
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jan 10, 2019
@knative-prow-robot knative-prow-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 10, 2019
@zxDiscovery zxDiscovery force-pushed the eventing-namespace branch 2 times, most recently from 2d1b7e3 to 09bbf3d Compare January 10, 2019 07:20

// Namespace holds the K8s namespace where our eventing system
// components run.
func Namespace() string {
Copy link
Member

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

Copy link
Author

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.

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.

Copy link
Contributor

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.

@Harwayne
Copy link
Contributor

/ok-to-test

@knative-prow-robot knative-prow-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 10, 2019
@zxDiscovery zxDiscovery force-pushed the eventing-namespace branch 6 times, most recently from 90dae52 to 760c38e Compare January 11, 2019 05:54
@zxDiscovery
Copy link
Author

/test pull-knative-eventing-go-coverage

1 similar comment
@zxDiscovery
Copy link
Author

/test pull-knative-eventing-go-coverage

Copy link
Contributor

@Harwayne Harwayne left a 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.

@zxDiscovery zxDiscovery force-pushed the eventing-namespace branch 2 times, most recently from 6c68d5b to fc3eeb5 Compare January 15, 2019 05:16
@zxDiscovery
Copy link
Author

/test pull-knative-eventing-go-coverage

@zxDiscovery
Copy link
Author

@Harwayne The PR knative/serving#2708 has already merged. Can we merge this PR now?

Copy link
Contributor

@Harwayne Harwayne left a 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.

)

func init() {
os.Setenv(system.NamespaceEnvKey, "knative-testing")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not knative-eventing?

Copy link
Author

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

Copy link
Contributor

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?

Copy link
Author

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).


// Namespace holds the K8s namespace where our eventing system
// components run.
func Namespace() string {
Copy link
Contributor

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.

@knative-prow-robot knative-prow-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Jan 18, 2019
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 19, 2019
@Harwayne
Copy link
Contributor

/hold cancel

@zxDiscovery zxDiscovery force-pushed the eventing-namespace branch 2 times, most recently from 911a070 to 8d0e8d1 Compare February 12, 2019 07:28
@knative-prow-robot knative-prow-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 12, 2019
@@ -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)
Copy link
Author

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

Copy link
Member

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)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@zxDiscovery
Copy link
Author

/test pull-knative-eventing-go-coverage

@knative-metrics-robot
Copy link

The following is the coverage report on pkg/.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
contrib/kafka/pkg/dispatcher/dispatcher.go 71.1% 70.1% -1.0

Copy link
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 14, 2019
@knative-prow-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot merged commit 0321cd0 into knative:master Feb 14, 2019
@zxDiscovery zxDiscovery deleted the eventing-namespace branch February 14, 2019 01:17
value: gcppubsub-channel-key
- name: DEFAULT_SECRET_KEY
value: key.json
env:
Copy link
Contributor

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:
Copy link
Contributor

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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indenting seems off

evankanderson pushed a commit that referenced this pull request Feb 20, 2019
knative-prow-robot pushed a commit that referenced this pull request Feb 20, 2019
evankanderson added a commit that referenced this pull request Feb 20, 2019
evankanderson added a commit that referenced this pull request Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants