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

Move serviceBroker references to clusterServiceBroker in controllers #1911

Merged
merged 11 commits into from
Apr 30, 2018

Conversation

eriknelson
Copy link
Contributor

This PR renames controller_broker.go to controller_clusterservicebroker.go and updates relevant controller references to make room for the namespaced servicebroker controller.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 4, 2018
@eriknelson
Copy link
Contributor Author

Investigating the travis failure.

@@ -39,7 +39,7 @@ const (
errorFetchingCatalogReason string = "ErrorFetchingCatalog"
errorFetchingCatalogMessage string = "Error fetching catalog. "
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you removed trailing space below, do it there too?

@@ -39,7 +39,7 @@ const (
errorFetchingCatalogReason string = "ErrorFetchingCatalog"
errorFetchingCatalogMessage string = "Error fetching catalog. "
errorSyncingCatalogReason string = "ErrorSyncingCatalog"
errorSyncingCatalogMessage string = "Error syncing catalog from ServiceBroker. "
errorSyncingCatalogMessage string = "Error syncing catalog from ServiceBroker."
Copy link
Contributor

Choose a reason for hiding this comment

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

s/ServiceBroker/ClusterServiceBroker

@@ -39,7 +39,7 @@ const (
errorFetchingCatalogReason string = "ErrorFetchingCatalog"
errorFetchingCatalogMessage string = "Error fetching catalog. "
errorSyncingCatalogReason string = "ErrorSyncingCatalog"
errorSyncingCatalogMessage string = "Error syncing catalog from ServiceBroker. "
errorSyncingCatalogMessage string = "Error syncing catalog from ServiceBroker."
Copy link
Contributor

Choose a reason for hiding this comment

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

Also I suspect we will have the same reasons/messages for namespaced service brokers, so we should probably prefix the variable names with cluster- too.

@@ -39,7 +39,7 @@ const (
errorFetchingCatalogReason string = "ErrorFetchingCatalog"
errorFetchingCatalogMessage string = "Error fetching catalog. "
errorSyncingCatalogReason string = "ErrorSyncingCatalog"
errorSyncingCatalogMessage string = "Error syncing catalog from ServiceBroker. "
errorSyncingCatalogMessage string = "Error syncing catalog from ServiceBroker."

errorListingClusterServiceClassesReason string = "ErrorListingServiceClasses"
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably missed in #1910: should error reason and message have Cluster?

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 5, 2018
@eriknelson
Copy link
Contributor Author

@nilebox Updated a bunch of the reason/messages with Cluster language. Let me know if that's what you had in mind?

@nilebox
Copy link
Contributor

nilebox commented Apr 6, 2018

@eriknelson looks good, but the tests are failing now, you need to update constants in them as well

Waited unsuccessfully for occurrence of "FetchedCatalog" in: "apiVersion: servicecatalog.k8s.io/v1beta1

@eriknelson
Copy link
Contributor Author

rebased

errorDeletingClusterServiceClassMessage string = "Error deleting service class."
errorDeletingClusterServicePlanReason string = "ErrorDeletingServicePlan"
errorDeletingClusterServicePlanMessage string = "Error deleting service plan."
errorFetchingClusterCatalogReason string = "ErrorFetchingClusterCatalog"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the error should still be ErrorFetchingCatalog

Copy link
Contributor

Choose a reason for hiding this comment

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

same comment for the other errors

Copy link
Contributor

Choose a reason for hiding this comment

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

Same - I don't think these constants should change.

Copy link
Contributor

@pmorie pmorie left a comment

Choose a reason for hiding this comment

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

I don't think the constants should be changing here.

@@ -30,8 +30,8 @@
"type": "Ready",
"status": "True",
"lastTransitionTime": "2018-01-11T20:53:31Z",
"reason": "FetchedCatalog",
"message": "Successfully fetched catalog entries from broker."
"reason": "FetchedClusterCatalog",
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't change this - it will break existing users of the API and I doubt this distinction needs to surface to users in any event.

"reason": "FetchedCatalog",
"message": "Successfully fetched catalog entries from broker."
"reason": "FetchedClusterCatalog",
"message": "Successfully fetched cluster catalog entries from broker."
Copy link
Contributor

Choose a reason for hiding this comment

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

Same thing with 'cluster' here - I don't think the additional wording is going to make a difference to users beyond confusing them.

@@ -131,7 +131,7 @@ USER_PROVIDED_SERVICE_ID="4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468"
kubectl create -f "${ROOT}/contrib/examples/walkthrough/ups-broker.yaml" \
|| error_exit 'Error when creating ups-broker.'

wait_for_expected_output -e 'FetchedCatalog' \
wait_for_expected_output -e 'FetchedClusterCatalog' \
Copy link
Contributor

Choose a reason for hiding this comment

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

nope :)

docs/cli.md Outdated
@@ -59,7 +59,7 @@ $ svcat get brokers

```console
$ svcat sync broker ups-broker
Successfully fetched catalog entries from the ups-broker broker
Successfully fetched cluster catalog entries from the ups-broker broker
Copy link
Contributor

Choose a reason for hiding this comment

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

nope :)

errorDeletingClusterServiceClassMessage string = "Error deleting service class."
errorDeletingClusterServicePlanReason string = "ErrorDeletingServicePlan"
errorDeletingClusterServicePlanMessage string = "Error deleting service plan."
errorFetchingClusterCatalogReason string = "ErrorFetchingClusterCatalog"
Copy link
Contributor

Choose a reason for hiding this comment

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

Same - I don't think these constants should change.

Status: Ready - Successfully fetched catalog entries from broker @ 2018-01-11 20:53:31 +0000 UTC
Name: ups-broker
URL: http://ups-broker-ups-broker.ups-broker.svc.cluster.local
Status: Ready - Successfully fetched cluster catalog entries from broker @ 2018-01-11 20:53:31 +0000 UTC
Copy link
Contributor

Choose a reason for hiding this comment

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

This still has 'cluster' in it, we should remove this.

@MHBauer MHBauer added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 19, 2018
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 24, 2018
@eriknelson eriknelson force-pushed the controller-csb branch 2 times, most recently from 8fb113e to 7860a5b Compare April 24, 2018 17:50
@eriknelson
Copy link
Contributor Author

@pmorie @MHBauer Rebased this and I think I hit your feedback items.

errorDeletingClusterServiceClassMessage string = "Error deleting service class."
errorDeletingClusterServicePlanReason string = "ErrorDeletingServicePlan"
errorDeletingClusterServicePlanMessage string = "Error deleting service plan."
errorSyncingCatalogMessage string = "Error syncing catalog from ClusterServiceBroker."
Copy link
Contributor

Choose a reason for hiding this comment

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

Also thought we agreed not to change these constants

@eriknelson
Copy link
Contributor Author

@pmorie reversed the const changes and rebased again

Copy link
Contributor

@pmorie pmorie left a comment

Choose a reason for hiding this comment

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

Just a couple minor nits and we're good on this one.

@@ -88,8 +88,8 @@ spec:
status:
conditions:
- lastTransitionTime: 2017-11-01T14:12:30Z
message: Successfully fetched catalog entries from broker.
reason: FetchedCatalog
message: Successfully fetched cluster catalog entries from broker.
Copy link
Contributor

Choose a reason for hiding this comment

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

Now this doc should have the changes reverted and we'll be good to go.

@@ -38,9 +38,9 @@ import (
// be easily combined with a follow on specific message.
const (
errorFetchingCatalogReason string = "ErrorFetchingCatalog"
errorFetchingCatalogMessage string = "Error fetching catalog. "
errorFetchingCatalogMessage string = "Error fetching catalog."
Copy link
Contributor

Choose a reason for hiding this comment

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

Note the trailing spaces; those are intentional because these strings are use to construct error messages. Would you restore the trailing spaces?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 Didn't realize those were deliberate; that makes sense.

* Update walkthrough doc to remove references to "cluster catalog"
* Restore trailing spaces used in composite error messages
@pmorie pmorie added the LGTM2 label Apr 30, 2018
@pmorie
Copy link
Contributor

pmorie commented Apr 30, 2018

Thanks, I'll merge on green

@pmorie pmorie merged commit 57eea81 into kubernetes-retired:master Apr 30, 2018
@eriknelson eriknelson deleted the controller-csb branch April 30, 2018 17:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. LGTM1 LGTM2 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants