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

Create brokercell on demand #1132

Merged
merged 13 commits into from
Jun 2, 2020

Conversation

liu-cong
Copy link
Contributor

@liu-cong liu-cong commented May 26, 2020

Ref #867
Fixes #1145

Proposed Changes

  • The broker controller also creates brokercell if it doesn't exist
  • Since the ingress will be managed by brokercell, broker status will look at brokercell status instead of ingress

Release Note


Docs

@liu-cong liu-cong requested a review from grantr May 26, 2020 20:33
@knative-prow-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@liu-cong
Copy link
Contributor Author

cc @yolocs

@liu-cong liu-cong requested a review from yolocs May 28, 2020 16:46
@liu-cong
Copy link
Contributor Author

/assign @yolocs

pkg/reconciler/broker/brokercell.go Outdated Show resolved Hide resolved
pkg/reconciler/broker/brokercell.go Outdated Show resolved Hide resolved
@liu-cong liu-cong marked this pull request as ready for review May 30, 2020 01:26
Copy link
Member

@yolocs yolocs left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liu-cong, yolocs

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

@liu-cong
Copy link
Contributor Author

liu-cong commented Jun 1, 2020

/test pull-google-knative-gcp-go-coverage

@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-google-knative-gcp-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/broker/v1beta1/broker_lifecycle.go 100.0% 93.3% -6.7
pkg/apis/broker/v1beta1/test_helper.go 100.0% 96.2% -3.8
pkg/reconciler/broker/controller.go 71.9% 100.0% 28.1
pkg/reconciler/broker/resources/brokercell.go Do not exist 100.0%

@@ -287,7 +277,7 @@ func (r *Reconciler) reconcileDecouplingTopicAndSubscription(ctx context.Context
topic, err = client.CreateTopicWithConfig(ctx, topicID, topicConfig)
if err != nil {
logger.Error("Failed to create Pub/Sub topic", zap.Error(err))
b.Status.MarkTopicFailed("CreationFailed", "Topic creation failed: %w", err)
b.Status.MarkTopicFailed("TopicCreationFailed", "Topic creation failed: %w", err)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the REASON field when you do kubectl get broker my-broker.

Copy link
Member

@yolocs yolocs left a comment

Choose a reason for hiding this comment

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

/lgtm

}
}
if err == nil {
r.Recorder.Eventf(b, corev1.EventTypeNormal, brokerCellCreated, "Created brokercell %s/%s", bc.Namespace, bc.Name)
Copy link
Member

Choose a reason for hiding this comment

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

nit: created => ensured. Could be confusing if there is an existing brokercell.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I think create is accurate here: Line 53 tries to create a brokercell, and this line only records the event when there is no error.

@knative-test-reporter-robot

The following jobs failed:

Test name Triggers Retries
pull-google-knative-gcp-wi-tests pull-google-knative-gcp-wi-tests
pull-google-knative-gcp-wi-tests
2/3

Automatically retrying due to test flakiness...
/test pull-google-knative-gcp-wi-tests

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved cla: yes (override cla status due to multiple authors bug) lgtm size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broker controller watch BrokerCell readiness and update Ready status on change
6 participants