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

Make svcat provision support namespaced resources #2618

Merged

Conversation

jberkhahn
Copy link
Contributor

  • add unit tests for provision_cmd.go
  • refactor provision_cmd.go to support new tests
  • fix typo ProvisonCmd -> ProvisionCmd

Note that the deleted goldenfile test was removed because the first call to the backend isn't a namespaced as it tries to locate exactly which cluster/namespaced service/plane the user is referring to. Thus, it no longer made sense in the current test frameworks. The args to the pkg lib (including the namespace) are tested in the newly added unit test for provision.go

Fixes #2371

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 26, 2019
Copy link
Contributor

@MHBauer MHBauer left a comment

Choose a reason for hiding this comment

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

/lgtm
for code, but
/hold
for some comment about the design to
"always resolve to kube name before acting" or some such

PlanReference: v1beta1.PlanReference{
ClusterServiceClassExternalName: className,
ClusterServicePlanExternalName: planName,
func (sdk *SDK) Provision(instanceName, classKubeName, planKubeName string, provisionClusterInstance bool, opts *ProvisionOptions) (*v1beta1.ServiceInstance, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this function changed because of the mentioned comment I'd like added.

It's always kube names that come in now.

@k8s-ci-robot k8s-ci-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 Apr 29, 2019
@k8s-ci-robot k8s-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 29, 2019
@jberkhahn jberkhahn removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 3, 2019
@jberkhahn
Copy link
Contributor Author

this has been changed and is ready for review @MHBauer @jboyd01

@@ -26,24 +27,29 @@ import (
"github.com/spf13/cobra"
)

type provisonCmd struct {
// ProvisionCmd contains the info needed to provision a new service instance
type ProvisionCmd struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to make ProvisionCmd public?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I completely refactored the testing here. As part of that, I moved the tests into their own package, as per Ginkgo guidelines. So, I had to export the struct type and it's fields.

@jboyd01
Copy link
Contributor

jboyd01 commented May 3, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jboyd01

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 3, 2019
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 10, 2019
- add unit tests for provision_cmd.go
- refactor provision_cmd.go to support new tests
- fix typo ProvisonCmd -> ProvisionCmd
@jberkhahn
Copy link
Contributor Author

/test pull-service-catalog-xbuild

1 similar comment
@jberkhahn
Copy link
Contributor Author

/test pull-service-catalog-xbuild

@MHBauer
Copy link
Contributor

MHBauer commented May 10, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 10, 2019
@k8s-ci-robot k8s-ci-robot merged commit 82ded7c into kubernetes-retired:master May 10, 2019
viviyww pushed a commit to viviyww/service-catalog that referenced this pull request Jun 20, 2019
…#2618)

- add unit tests for provision_cmd.go
- refactor provision_cmd.go to support new tests
- fix typo ProvisonCmd -> ProvisionCmd
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF 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.

enhance svcat provision to support namespace scoped resources
5 participants